Author: ggregory Date: Tue Jan 22 07:05:41 2013 New Revision: 1436767 URL: http://svn.apache.org/viewvc?rev=1436767&view=rev Log: Add final modifier to private fields.
Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/ConstructorUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/Parent.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/PrivatelyShadowedChild.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/SerializationUtils.java Tue Jan 22 07:05:41 2013 @@ -266,7 +266,7 @@ public class SerializationUtils { static class ClassLoaderAwareObjectInputStream extends ObjectInputStream { private static final Map<String, Class<?>> primitiveTypes = new HashMap<String, Class<?>>(); - private ClassLoader classLoader; + private final ClassLoader classLoader; /** * Constructor. Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java Tue Jan 22 07:05:41 2013 @@ -466,7 +466,7 @@ public class StringUtilsEqualsIndexOfTes // other object be an instance of CustomCharSequence, even though, as char sequences, // `seq` may equal the other object. private static class CustomCharSequence implements CharSequence { - private CharSequence seq; + private final CharSequence seq; public CustomCharSequence(CharSequence seq) { this.seq = seq; Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java Tue Jan 22 07:05:41 2013 @@ -128,7 +128,7 @@ public class EqualsBuilderTest { static class TestTTLeafObject extends TestTTSubObject { @SuppressWarnings("unused") - private int leafValue; + private final int leafValue; public TestTTLeafObject(int a, int t, int tt, int leafValue) { super(a, t, tt); this.leafValue = leafValue; @@ -938,7 +938,7 @@ public class EqualsBuilderTest { } public static class TestACanEqualB { - private int a; + private final int a; public TestACanEqualB(int a) { this.a = a; @@ -969,7 +969,7 @@ public class EqualsBuilderTest { } public static class TestBCanEqualA { - private int b; + private final int b; public TestBCanEqualA(int b) { this.b = b; @@ -1065,11 +1065,11 @@ public class EqualsBuilderTest { static class TestObjectWithMultipleFields { @SuppressWarnings("unused") - private TestObject one; + private final TestObject one; @SuppressWarnings("unused") - private TestObject two; + private final TestObject two; @SuppressWarnings("unused") - private TestObject three; + private final TestObject three; public TestObjectWithMultipleFields(int one, int two, int three) { this.one = new TestObject(one); @@ -1111,7 +1111,7 @@ public class EqualsBuilderTest { @SuppressWarnings("unused") private TestObjectReference reference; @SuppressWarnings("unused") - private TestObject one; + private final TestObject one; public TestObjectReference(int one) { this.one = new TestObject(one); Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java Tue Jan 22 07:05:41 2013 @@ -33,10 +33,10 @@ public class ReflectionToStringBuilderEx class TestFixture { @SuppressWarnings("unused") - private String secretField = SECRET_VALUE; + private final String secretField = SECRET_VALUE; @SuppressWarnings("unused") - private String showField = NOT_SECRET_VALUE; + private final String showField = NOT_SECRET_VALUE; } private static final String NOT_SECRET_FIELD = "showField"; Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java Tue Jan 22 07:05:41 2013 @@ -40,7 +40,7 @@ public class ReflectionToStringBuilderMu class TestFixture { final private LinkedList<Integer> listField = new LinkedList<Integer>(); final private Random random = new Random(); - private int N = 100; + private final int N = 100; public TestFixture() { synchronized (this) { Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java Tue Jan 22 07:05:41 2013 @@ -359,14 +359,14 @@ public class ToStringBuilderTest { static class ReflectionTestFixtureA { @SuppressWarnings("unused") - private char a='a'; + private final char a='a'; @SuppressWarnings("unused") private transient char transientA='t'; } static class ReflectionTestFixtureB extends ReflectionTestFixtureA { @SuppressWarnings("unused") - private char b='b'; + private final char b='b'; @SuppressWarnings("unused") private transient char transientB='t'; } @@ -489,7 +489,7 @@ public class ToStringBuilderTest { private static class SelfInstanceVarReflectionTestFixture { @SuppressWarnings("unused") - private SelfInstanceVarReflectionTestFixture typeIsSelf; + private final SelfInstanceVarReflectionTestFixture typeIsSelf; public SelfInstanceVarReflectionTestFixture() { this.typeIsSelf = this; @@ -503,8 +503,8 @@ public class ToStringBuilderTest { private static class SelfInstanceTwoVarsReflectionTestFixture { @SuppressWarnings("unused") - private SelfInstanceTwoVarsReflectionTestFixture typeIsSelf; - private String otherType = "The Other Type"; + private final SelfInstanceTwoVarsReflectionTestFixture typeIsSelf; + private final String otherType = "The Other Type"; public SelfInstanceTwoVarsReflectionTestFixture() { this.typeIsSelf = this; Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/event/EventUtilsTest.java Tue Jan 22 07:05:41 2013 @@ -201,7 +201,7 @@ public class EventUtilsTest private static class EventCountingInvociationHandler implements InvocationHandler { - private Map<String, Integer> eventCounts = new TreeMap<String, Integer>(); + private final Map<String, Integer> eventCounts = new TreeMap<String, Integer>(); public <L> L createListener(Class<L> listenerType) { @@ -234,7 +234,7 @@ public class EventUtilsTest public static class MultipleEventSource { - private EventListenerSupport<MultipleEventListener> listeners = EventListenerSupport.create(MultipleEventListener.class); + private final EventListenerSupport<MultipleEventListener> listeners = EventListenerSupport.create(MultipleEventListener.class); public void addMultipleEventListener(MultipleEventListener listener) { @@ -252,7 +252,7 @@ public class EventUtilsTest public static class PropertyChangeSource { - private EventListenerSupport<PropertyChangeListener> listeners = EventListenerSupport.create(PropertyChangeListener.class); + private final EventListenerSupport<PropertyChangeListener> listeners = EventListenerSupport.create(PropertyChangeListener.class); private String property; Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/ConstructorUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/ConstructorUtilsTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/ConstructorUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/ConstructorUtilsTest.java Tue Jan 22 07:05:41 2013 @@ -34,7 +34,7 @@ import org.apache.commons.lang3.mutable. */ public class ConstructorUtilsTest { public static class TestBean { - private String toString; + private final String toString; public TestBean() { toString = "()"; @@ -72,7 +72,7 @@ public class ConstructorUtilsTest { } } - private Map<Class<?>, Class<?>[]> classCache; + private final Map<Class<?>, Class<?>[]> classCache; public ConstructorUtilsTest() { classCache = new HashMap<Class<?>, Class<?>[]>(); Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java Tue Jan 22 07:05:41 2013 @@ -54,7 +54,7 @@ public class FieldUtilsTest { private PublicChild publicChild; private PubliclyShadowedChild publiclyShadowedChild; private PrivatelyShadowedChild privatelyShadowedChild; - private Class<?> parentClass = PublicChild.class.getSuperclass(); + private final Class<?> parentClass = PublicChild.class.getSuperclass(); @Before public void setUp() { Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java Tue Jan 22 07:05:41 2013 @@ -126,7 +126,7 @@ public class MethodUtilsTest { } private TestBean testBean; - private Map<Class<?>, Class<?>[]> classCache = new HashMap<Class<?>, Class<?>[]>(); + private final Map<Class<?>, Class<?>[]> classCache = new HashMap<Class<?>, Class<?>[]>(); @Before public void setUp() throws Exception { Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/Parent.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/Parent.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/Parent.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/Parent.java Tue Jan 22 07:05:41 2013 @@ -24,5 +24,5 @@ class Parent implements Foo { protected boolean b = false; int i = 0; @SuppressWarnings("unused") - private double d = 0.0; + private final double d = 0.0; } Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/PrivatelyShadowedChild.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/PrivatelyShadowedChild.java?rev=1436767&r1=1436766&r2=1436767&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/PrivatelyShadowedChild.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/testbed/PrivatelyShadowedChild.java Tue Jan 22 07:05:41 2013 @@ -21,8 +21,8 @@ package org.apache.commons.lang3.reflect */ @SuppressWarnings({ "unused", "hiding" }) // deliberate re-use of variable names public class PrivatelyShadowedChild extends Parent { - private String s = "ss"; - private boolean b = true; - private int i = 1; - private double d = 1.0; + private final String s = "ss"; + private final boolean b = true; + private final int i = 1; + private final double d = 1.0; }