This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-weaver.git
The following commit(s) were added to refs/heads/master by this push:
new ee16aed Add final to static fields in test and example code
ee16aed is described below
commit ee16aedc340c626aece02f1d9ca02387a0f2e32f
Author: Sebb <[email protected]>
AuthorDate: Sun Dec 28 18:12:44 2025 +0000
Add final to static fields in test and example code
---
.../java/org/apache/commons/weaver/privilizer/example/Utils.java | 2 +-
.../java/org/apache/commons/weaver/test/weaver/TestWeaver.java | 8 ++++----
src/changes/changes.xml | 1 +
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git
a/modules/privilizer/weaver/src/it/sample/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java
b/modules/privilizer/weaver/src/it/sample/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java
index d58f46d..07b913c 100644
---
a/modules/privilizer/weaver/src/it/sample/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java
+++
b/modules/privilizer/weaver/src/it/sample/src/main/java/org/apache/commons/weaver/privilizer/example/Utils.java
@@ -57,7 +57,7 @@ public final class Utils {
return System.getProperty(key);
}
- private static Integer n;
+ private static final Integer n;
static {
n = Integer.valueOf(999);
}
diff --git
a/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java
b/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java
index 1eff794..e27eeb1 100644
---
a/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java
+++
b/processor/src/test/java/org/apache/commons/weaver/test/weaver/TestWeaver.java
@@ -39,10 +39,10 @@ import org.junit.Assert;
/**
*/
public class TestWeaver implements Weaver {
- public static List<Method> wovenMethods = new ArrayList<Method>();
- public static List<Class<?>> wovenClasses = new ArrayList<Class<?>>();
- public static List<Class<?>> implementors = new ArrayList<Class<?>>();
- public static List<Class<?>> subclasses = new ArrayList<Class<?>>();
+ public static final List<Method> wovenMethods = new ArrayList<Method>();
+ public static final List<Class<?>> wovenClasses = new
ArrayList<Class<?>>();
+ public static final List<Class<?>> implementors = new
ArrayList<Class<?>>();
+ public static final List<Class<?>> subclasses = new ArrayList<Class<?>>();
@Override
public boolean process(final WeaveEnvironment environment, final Scanner
scanner) {
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 4cbb77f..18bd4f0 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -27,6 +27,7 @@
<!-- FIX -->
<action type="fix" dev="ggregory" due-to="John Patrick">Use JUnit 5
assertThrows() #11, #12.</action>
<action type="fix" dev="sebb">Construct nested class to avoid
compilation error</action>
+ <action type="fix" dev="sebb">Add final to static fields in test and
example code</action>
<!-- UPDATE -->
<action type="update" dev="sebb">Commons Lang 3.7 -> 3.8.1. Fixes:
java.lang.NullPointerException
at org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast
(SystemUtils.java:1654)</action>