Skip to content

Commit 4386e19

Browse files
committed
Don't initialize instance variables to their default values
1 parent dd783f9 commit 4386e19

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

src/main/java/org/apache/commons/beanutils/BeanComparator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
public class BeanComparator<T> implements Comparator<T>, Serializable {
4949

5050
private static final long serialVersionUID = 1L;
51-
51+
5252
/**
5353
* Method name to call to compare.
5454
*/
5555
private String property;
56-
56+
5757
/**
5858
* BeanComparator will pass the values of the specified bean property to this Comparator. If your bean property is not a comparable or contains null values,
5959
* a suitable comparator may be supplied in this constructor.

src/main/java/org/apache/commons/beanutils/BeanUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class BeanUtils {
4444
* this class.
4545
*/
4646
@Deprecated
47-
private static int debug = 0;
47+
private static int debug;
4848

4949
/**
5050
* <p>Clone a bean based on the available property getters and setters,

src/main/java/org/apache/commons/beanutils/ConversionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class ConversionException extends RuntimeException {
3333
* @deprecated Use {@link Throwable#getCause()}}.
3434
*/
3535
protected Throwable cause;
36-
36+
3737
/**
3838
* Constructs a new exception with the specified message.
3939
*

src/main/java/org/apache/commons/beanutils/DynaProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ private void writeAnyClass(final Class<?> clazz, final ObjectOutputStream out) t
338338
/**
339339
* Writes this object safely. There are issues with serializing primitive class types on certain JVM versions (including java 1.3). This method provides a
340340
* workaround.
341-
*
341+
*
342342
* @param out Where to write.
343343
* @throws IOException if I/O errors occur while writing to the underlying stream.
344344
*/

src/main/java/org/apache/commons/beanutils/MethodUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public int hashCode() {
125125
* really optional we can ignore this problem; only one of the webapps
126126
* will get the warning in its logs but that should be good enough.
127127
*/
128-
private static boolean loggedAccessibleWarning = false;
128+
private static boolean loggedAccessibleWarning;
129129

130130
/**
131131
* Indicates whether methods should be cached for improved performance.

src/main/java/org/apache/commons/beanutils/PropertyUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class PropertyUtils {
112112
* @deprecated The <code>debug</code> static property is no longer used
113113
*/
114114
@Deprecated
115-
private static int debug = 0;
115+
private static int debug;
116116

117117
/**
118118
* Adds a <code>BeanIntrospector</code>. This object is invoked when the

src/main/java/org/apache/commons/beanutils/PropertyUtilsBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ private static Map<String, Object> toPropertyMap(final Object obj) {
136136
* The cache of PropertyDescriptor arrays for beans we have already
137137
* introspected, keyed by the java.lang.Class of this object.
138138
*/
139-
private WeakFastHashMap<Class<?>, BeanIntrospectionData> descriptorsCache = null;
139+
private WeakFastHashMap<Class<?>, BeanIntrospectionData> descriptorsCache;
140140

141-
private WeakFastHashMap<Class<?>, FastHashMap> mappedDescriptorsCache = null;
141+
private WeakFastHashMap<Class<?>, FastHashMap> mappedDescriptorsCache;
142142

143143

144144
/** Log instance */

src/main/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private static String initDefaultChars() {
6666

6767

6868
/** Should the date conversion be lenient? */
69-
boolean isLenient = false;
69+
boolean isLenient;
7070

7171
/**
7272
* Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}

src/test/java/org/apache/commons/beanutils/A.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
public class A {
2828

29-
boolean called = false;
29+
boolean called;
3030

3131
public void foo(final OutputStream os)
3232
{

src/test/java/org/apache/commons/beanutils/BeanificationTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class BeanificationTestCase extends TestCase {
4040

4141
class Signal {
4242
private Exception e;
43-
private int signal = 0;
43+
private int signal;
4444
private BeanUtilsBean bean;
4545
private PropertyUtilsBean propertyUtils;
4646
private ConvertUtilsBean convertUtils;

0 commit comments

Comments
 (0)