This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch merge/master-to-7xx-2024-09-01 in repository https://gitbox.apache.org/repos/asf/struts.git
commit 9fa6dd96f6d21cfbc551467aa336c04f2a92ceea Merge: e62ee8fcb f388f6a67 Author: Lukasz Lenart <lukaszlen...@apache.org> AuthorDate: Mon Sep 2 08:37:26 2024 +0200 Merge branch 'master' into merge/master-to-7xx-2024-09-01 .github/workflows/codeql.yml | 6 ++-- .github/workflows/scorecards-analysis.yaml | 6 ++-- apps/showcase/pom.xml | 2 +- .../com/opensymphony/xwork2/ognl/OgnlUtil.java | 23 +++++++++++++- .../struts2/components/IteratorComponent.java | 5 ++- .../com/opensymphony/xwork2/ognl/OgnlUtilTest.java | 16 ++++++++++ .../struts2/components/IteratorComponentTest.java | 36 ++++++++++++++++++++++ .../apache/struts2/views/jsp/IteratorTagTest.java | 35 +++++++++++++++++++++ pom.xml | 22 ++++++------- 9 files changed, 131 insertions(+), 20 deletions(-) diff --cc .github/workflows/codeql.yml index 11e27f287,6f0b4ece8..3d0c778ec --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@@ -45,14 -43,8 +45,14 @@@ jobs steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Setup Java JDK + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + cache: 'maven' - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v3.26.6 with: languages: ${{ matrix.language }} - name: Autobuild diff --cc core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java index 0d96337da,40c2dbddf..a88860836 --- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java @@@ -1644,10 -1645,22 +1644,26 @@@ public class OgnlUtilTest extends XWork assertThrows(OgnlException.class, () -> ognlUtil.getValue(vulnerableExpr, ognlUtil.createDefaultContext(null), null)); } + private OgnlUtil generateOgnlUtilInstanceWithDefaultLRUCacheFactories() { + return generateOgnlUtilInstanceWithDefaultLRUCacheFactories(25, 25); + } + + public void testCompilationErrorsCached() throws Exception { + OgnlException e = assertThrows(OgnlException.class, () -> ognlUtil.compile(".literal.$something")); + StackTraceElement[] stackTrace = e.getStackTrace(); + assertThat(stackTrace).isEmpty(); + StackTraceElement[] causeStackTrace = e.getCause().getStackTrace(); + assertThat(causeStackTrace).isNotEmpty(); + + OgnlException e2 = assertThrows(OgnlException.class, () -> ognlUtil.compile(".literal.$something")); + StackTraceElement[] stackTrace2 = e2.getStackTrace(); + assertThat(stackTrace2).isEmpty(); + StackTraceElement[] causeStackTrace2 = e2.getCause().getStackTrace(); + + assertThat(causeStackTrace2).isEmpty(); // Stack trace cleared before rethrow + assertSame(e, e2); // Exception is cached + } + /** * Generate a new OgnlUtil instance (not configured by the {@link ContainerBuilder}) that can be used for * basic tests, with its Expression and BeanInfo factories set to LRU mode. diff --cc pom.xml index 2dbda17bc,67aa38827..15eb28004 --- a/pom.xml +++ b/pom.xml @@@ -111,20 -110,16 +111,20 @@@ <!-- dependency versions in alphanumeric order --> <asm.version>9.7</asm.version> + <byte-buddy.version>1.14.11</byte-buddy.version> + <freemarker.version>2.3.33</freemarker.version> + <hibernate-validator.version>8.0.1.Final</hibernate-validator.version> <jackson.version>2.17.2</jackson.version> <log4j2.version>2.23.1</log4j2.version> - <maven-surefire-plugin.version>3.3.1</maven-surefire-plugin.version> ++ <maven-surefire-plugin.version>3.4.0</maven-surefire-plugin.version> + <mockito.version>5.8.0</mockito.version> <ognl.version>3.3.5</ognl.version> + <sitemesh.version>2.5.0</sitemesh.version> - <slf4j.version>2.0.13</slf4j.version> + <slf4j.version>2.0.16</slf4j.version> - <spring.platformVersion>5.3.39</spring.platformVersion> + <spring.platformVersion>6.0.13</spring.platformVersion> <tiles.version>3.0.8</tiles.version> <tiles-request.version>1.0.7</tiles-request.version> - <maven-surefire-plugin.version>3.4.0</maven-surefire-plugin.version> - <hibernate-validator.version>6.2.4.Final</hibernate-validator.version> - <freemarker.version>2.3.33</freemarker.version> + <velocity-tools.version>3.1</velocity-tools.version> <!-- Site generation --> <fluido-skin.version>1.9</fluido-skin.version>