You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/07/06 14:00:29 UTC

(commons-bcel) branch master updated (c54a16d7 -> a744541f)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git


    from c54a16d7 Bump github/codeql-action from 3.29.1 to 3.29.2 (#443)
     new 5824eae0 Reduce vertical whitespace
     new a744541f Bump org.apache.commons:commons-parent from 79 to 85

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/maven.yml                            |  2 +-
 pom.xml                                                |  2 +-
 src/changes/changes.xml                                |  5 ++++-
 src/conf/spotbugs-exclude-filter.xml                   | 18 ++----------------
 .../java/org/apache/bcel/classfile/ConstantUtf8.java   |  4 ++--
 .../bcel/classfile/ConstantPoolModuleAccessTest.java   | 15 +++++++++++----
 6 files changed, 21 insertions(+), 25 deletions(-)


(commons-bcel) 02/02: Bump org.apache.commons:commons-parent from 79 to 85

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit a744541f93e46f5bc326c9586bb177dd1ed3a8a1
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Sun Jul 6 10:00:25 2025 -0400

    Bump org.apache.commons:commons-parent from 79 to 85
    
    - Fix [ERROR] Medium: Operation on the "created" shared variable in
    "ConstantUtf8" class is not atomic
    [org.apache.bcel.classfile.ConstantUtf8] At ConstantUtf8.java:[line 119]
    AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE
    - Fix [ERROR] Medium: Operation on the "considered" shared variable in
    "ConstantUtf8" class is not atomic
    [org.apache.bcel.classfile.ConstantUtf8] At ConstantUtf8.java:[line 137]
    AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE
    - Fix [ERROR] Medium: Operation on the "skipped" shared variable in
    "ConstantUtf8" class is not atomic
    [org.apache.bcel.classfile.ConstantUtf8] At ConstantUtf8.java:[line 134]
    AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE
    - Update test for JUnit's junit-platform-commons-1.13.1
---
 .github/workflows/maven.yml                               |  2 +-
 pom.xml                                                   |  2 +-
 src/changes/changes.xml                                   |  5 ++++-
 src/main/java/org/apache/bcel/classfile/ConstantUtf8.java |  4 ++--
 .../bcel/classfile/ConstantPoolModuleAccessTest.java      | 15 +++++++++++----
 5 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index b503f5ff..8605c0ef 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -56,4 +56,4 @@ jobs:
         distribution: 'temurin'
         java-version: ${{ matrix.java }}
     - name: Build with Maven
-      run: mvn --errors --show-version --batch-mode --no-transfer-progress -DtrimStackTrace=false
+      run: mvn --errors --show-version --batch-mode --no-transfer-progress -DtrimStackTrace=false -Ddoclint=none
diff --git a/pom.xml b/pom.xml
index 788ee5f5..c0257196 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
-    <version>79</version>
+    <version>85</version>
   </parent>
   <groupId>org.apache.bcel</groupId>
   <artifactId>bcel</artifactId>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5556f5d1..b85d1755 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,13 +65,16 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="BCEL-375" type="fix" dev="ggregory" due-to="J. Lewis Muir, Gary Gregory">Wrong permissions on bcel .jar file in binary .tar.gz distribution file.</action>
       <action issue="BCEL-376" type="fix" dev="ggregory" due-to="Dominik Stadler, Gary Gregory">ClassPath.close() throws UnsupportedOperationException when created with system-classpath.</action>
       <action                  type="fix" dev="ggregory" due-to="Gary Gregory">ClassPath.getResources(String) can use an ArrayList instead of a Vector.</action>
+      <action                  type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: Operation on the "created" shared variable in "ConstantUtf8" class is not atomic [org.apache.bcel.classfile.ConstantUtf8] At ConstantUtf8.java:[line 119] AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE.</action>
+      <action                  type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: Operation on the "considered" shared variable in "ConstantUtf8" class is not atomic [org.apache.bcel.classfile.ConstantUtf8] At ConstantUtf8.java:[line 137] AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE.</action>
+      <action                  type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: Operation on the "skipped" shared variable in "ConstantUtf8" class is not atomic [org.apache.bcel.classfile.ConstantUtf8] At ConstantUtf8.java:[line 134] AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE.</action>      
       <!-- ADD -->
       <action                  type="update" dev="ggregory" due-to="Gary Gregory">Add Const.MAJOR_25.</action>
       <action                  type="update" dev="ggregory" due-to="Gary Gregory">Add Const.MINOR_25.</action>
       <!-- UPDATE -->
       <action                  type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0 #334, #341, #351.</action>
       <action                  type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump org.jetbrains.kotlin:kotlin-stdlib from 2.0.0 to 2.2.0 #340, #347, #369, #390, #407, #422, #434, #441.</action>
-      <action                  type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump org.apache.commons:commons-parent from 72 to 79 #346, #349, #559, #364, #368, #378.</action>
+      <action                  type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump org.apache.commons:commons-parent from 72 to 85 #346, #349, #559, #364, #368, #378.</action>
       <action                  type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump commons-io:commons-io from 2.16.1 to 2.19.0 #357, #387.</action>
       <action                  type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump jna.version from 5.14.0 to 5.17.0 #358, #399.</action>
       <action                  type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump org.codehaus.mojo:taglist-maven-plugin from 3.1.0 to 3.2.1 #376.</action>
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java b/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java
index 559511f4..0e56ce03 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java
@@ -115,7 +115,7 @@ public final class ConstantUtf8 extends Constant {
     }
 
     // Avoid Spotbugs complaint about Write to static field
-    private static void countCreated() {
+    private static synchronized void countCreated() {
         created++;
     }
 
@@ -129,7 +129,7 @@ public final class ConstantUtf8 extends Constant {
      * @return a new or cached instance of the given value.
      * @since 6.0
      */
-    public static ConstantUtf8 getCachedInstance(final String value) {
+    public static synchronized ConstantUtf8 getCachedInstance(final String value) {
         if (value.length() > Cache.MAX_ENTRY_SIZE) {
             skipped++;
             return new ConstantUtf8(value);
diff --git a/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleAccessTest.java b/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleAccessTest.java
index 9347cfbd..f24bec85 100644
--- a/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleAccessTest.java
+++ b/src/test/java/org/apache/bcel/classfile/ConstantPoolModuleAccessTest.java
@@ -29,6 +29,8 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
 import java.util.stream.Stream;
 
 import org.apache.bcel.Const;
@@ -74,6 +76,10 @@ public final class ConstantPoolModuleAccessTest {
                         expected.add("org.junit.platform.launcher.PostDiscoveryFilter");
                         expected.add("org.junit.platform.launcher.TestExecutionListener");
                         assertEquals(expected, Arrays.asList(usedClassNames));
+                    } else if (urlPath.contains("junit-platform-common")) {
+                        final List<String> expected = new ArrayList<>();
+                        expected.add("org.junit.platform.commons.support.scanning.ClasspathScanner");
+                        assertEquals(expected, Arrays.asList(usedClassNames));
                     } else if (urlPath.contains("junit-platform-engine")) {
                         final List<String> expected = new ArrayList<>();
                         expected.add("org.junit.platform.engine.discovery.DiscoverySelectorIdentifierParser");
@@ -264,7 +270,7 @@ public final class ConstantPoolModuleAccessTest {
                         expected.add("jdk.internal.netscape.javascript.spi.JSObjectProvider");
                         assertEquals(expected, Arrays.asList(usedClassNames));
                     } else {
-                        assertEquals(0, usedClassNames.length, "Found " + Arrays.toString(usedClassNames) + " in " + urlPath);
+                        assertEquals(0, usedClassNames.length, () -> "Found " + Arrays.toString(usedClassNames) + " in " + urlPath);
                     }
                     super.visitModule(obj);
                 }
@@ -275,7 +281,7 @@ public final class ConstantPoolModuleAccessTest {
                     final String packageName = obj.getPackageName(constantPool);
                     final String[] toModuleNames = obj.getToModuleNames(constantPool);
                     if (url.getPath().contains("junit-platform-commons")) {
-                        final List<String> expected = new ArrayList<>();
+                        final Set<String> expected = new TreeSet<>();
                         expected.add("org.junit.jupiter.api");
                         expected.add("org.junit.jupiter.engine");
                         expected.add("org.junit.jupiter.migrationsupport");
@@ -292,13 +298,14 @@ public final class ConstantPoolModuleAccessTest {
                             expected.add("org.junit.platform.suite.engine");
                             expected.add("org.junit.platform.testkit");
                             expected.add("org.junit.vintage.engine");
-                            assertEquals(expected, Arrays.asList(toModuleNames));
+                            expected.add("org.junit.platform.jfr");
+                            assertEquals(expected, new TreeSet<>(Arrays.asList(toModuleNames)));
                             break;
                         case "org.junit.platform.commons.logging":
                             expected.add("org.junit.platform.suite.engine");
                             expected.add("org.junit.platform.testkit");
                             expected.add("org.junit.vintage.engine");
-                            assertEquals(expected, Arrays.asList(toModuleNames));
+                            assertEquals(expected, new TreeSet<>(Arrays.asList(toModuleNames)));
                             break;
                         default:
                             assertEquals(0, toModuleNames.length);


(commons-bcel) 01/02: Reduce vertical whitespace

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 5824eae005509171ccb6637c5f93eeff0169f7e6
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Sun Jul 6 09:21:25 2025 -0400

    Reduce vertical whitespace
---
 src/conf/spotbugs-exclude-filter.xml | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index b40dc92d..65f42d0c 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -24,32 +24,28 @@
 <FindBugsFilter
     xmlns="https://github.com/spotbugs/filter/3.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd"><!-- Using wild-card class names so exclusions work regardless of the top-level package -->
-
+    xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
+  <!-- Using wild-card class names so exclusions work regardless of the top-level package -->
   <!-- https://github.com/spotbugs/spotbugs/issues/2710 -->
   <Match>
     <Class name="~.*" />
     <Bug pattern="CT_CONSTRUCTOR_THROW" />
   </Match>
-
   <!-- Waiting on BCEL-252 -->
   <Match>
     <Class name="~.*\.util\.Class2HTML" />
     <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
   </Match>
-
   <!-- Class is not supposed to be an Exception itself -->
   <Match>
     <Class name="~.*\.classfile\.CodeException" />
     <Bug pattern="NM_CLASS_NOT_EXCEPTION" />
   </Match>
-
   <!-- Ignore GC here -->
   <Match>
     <Class name="~.*\.verifier\.TransitiveHull" />
     <Bug pattern="DM_GC" />
   </Match>
-
   <!-- clone() creates a new instance so does not need to call super.clone() -->
   <Match>
     <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/>
@@ -59,7 +55,6 @@
       <Class name="~.*\.verifier\.structurals\.OperandStack"/>
     </Or>
   </Match>
-
   <!-- Binary compatibility -->
   <Match>
     <Class name="org.apache.bcel.Repository"/>
@@ -78,7 +73,6 @@
     <Field name="IGNORED"/>
     <Bug pattern="MS_PKGPROTECT"/>
   </Match>
-
   <!--
     TODO: this should probably be sinplified
      Medium: Complicated, subtle or wrong increment in for-loop
@@ -91,7 +85,6 @@
     <Method name="printFlags" params="int, org.apache.bcel.util.BCELifier$FLAGS" returns="java.lang.String"/>
     <Bug pattern="QF_QUESTIONABLE_FOR_LOOP"/>
   </Match>
-
   <!-- Reason: TODO, perhaps? -->
   <Match>
     <Class name="~.*" />
@@ -100,13 +93,11 @@
       <Bug pattern="EI_EXPOSE_REP2" />
     </Or>
   </Match>
-
   <!-- TODO - enable later -->
   <Match>
     <Class name="~.*" />
     <Bug pattern="MS_MUTABLE_ARRAY" />
   </Match>
-
   <!-- Test data classes -->
   <Match>
     <Or>
@@ -114,7 +105,6 @@
       <Class name="~.*\.tests\.Test.*" />
     </Or>
   </Match>
-
   <!--
     This is intentional
     Error:  Switch statement found in org.apache.bcel.util.BCELFactory.visitAllocationInstruction(AllocationInstruction)
@@ -128,7 +118,6 @@
     <Method name="visitAllocationInstruction"/>
     <Bug pattern="SF_SWITCH_FALLTHROUGH"/>
   </Match>
-
   <!--
     Class is deprecated
     Error:  The class name org.apache.bcel.util.ClassLoader
@@ -146,7 +135,6 @@
       <Bug pattern="MS_PKGPROTECT"/>
     </Or>
   </Match>
-
   <!--
     TODO: field is deprecated in preparation for making it private later
     Error:  org.apache.bcel.verifier.structurals.Frame._this should be package protected
@@ -158,7 +146,6 @@
     <Field name="_this"/>
     <Bug pattern="MS_PKGPROTECT"/>
   </Match>
-
   <!-- TODO Is this really identity equality and not object equality? -->
   <Match>
     <Class name="Mini.ASTFunDecl"/>
@@ -170,7 +157,6 @@
     <Class name="Mini.Environment"/>
     <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/>
   </Match>
-
   <!-- Skip JavaCC generated code. -->
   <Match>
     <Class name="Mini.MiniParser"/>