Skip to content

Commit dd783f9

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

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
*/
103103
public class ContextClassLoaderLocal<T> {
104104
private final Map<ClassLoader, T> valueByClassLoader = new WeakHashMap<>();
105-
private boolean globalValueInitialized = false;
105+
private boolean globalValueInitialized;
106106
private T globalValue;
107107

108108
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class LazyDynaClass extends BasicDynaClass implements MutableDynaClass {
5656
*
5757
* <p>Default is <code>false</code>.
5858
*/
59-
protected boolean returnNull = false;
59+
protected boolean returnNull;
6060

6161
/**
6262
* Construct a new LazyDynaClass with default parameters.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class LazyDynaMap extends LazyDynaBean implements MutableDynaClass {
6565
*
6666
* <p>Default is <code>false</code>.
6767
*/
68-
protected boolean returnNull = false;
68+
protected boolean returnNull;
6969

7070
/**
7171
* Constructs a new instance.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class ResultSetIterator implements DynaBean, Iterator<DynaBean> {
3434
* <p>Flag indicating whether the result set is currently positioned at a
3535
* row for which we have not yet returned an element in the iteration.</p>
3636
*/
37-
protected boolean current = false;
37+
protected boolean current;
3838

3939
/**
4040
* <p>The {@link ResultSetDynaClass} we are associated with.</p>
@@ -45,7 +45,7 @@ public class ResultSetIterator implements DynaBean, Iterator<DynaBean> {
4545
* <p>Flag indicating whether the result set has indicated that there are
4646
* no further rows.</p>
4747
*/
48-
protected boolean eof = false;
48+
protected boolean eof;
4949

5050
/**
5151
* <p>Construct an <code>Iterator</code> for the result set being wrapped

src/main/java/org/apache/commons/beanutils/converters/AbstractConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public abstract class AbstractConverter implements Converter {
7272
/**
7373
* Should we return the default value on conversion errors?
7474
*/
75-
private boolean useDefault = false;
75+
private boolean useDefault;
7676

7777
/**
7878
* The default value specified to our Constructor, if any.

src/main/java/org/apache/commons/beanutils/locale/BaseLocaleConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private static <T> T checkConversionResult(final Class<T> type, final Object res
7575
private Object defaultValue;
7676

7777
/** Should we return the default value on conversion errors? */
78-
protected boolean useDefault = false;
78+
protected boolean useDefault;
7979

8080
/** The locale specified to our Constructor, by default - system locale. */
8181
protected Locale locale = Locale.getDefault();
@@ -85,7 +85,7 @@ private static <T> T checkConversionResult(final Class<T> type, final Object res
8585

8686

8787
/** The flag indicating whether the given pattern string is localized or not. */
88-
protected boolean locPattern = false;
88+
protected boolean locPattern;
8989

9090
/**
9191
* Create a {@link LocaleConverter} that will throw a {@link ConversionException}

src/main/java/org/apache/commons/beanutils/locale/LocaleConvertUtilsBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static LocaleConvertUtilsBean getInstance() {
182182
private Locale defaultLocale = Locale.getDefault();
183183

184184
/** Indicate whether the pattern is localized or not */
185-
private boolean applyLocalized = false;
185+
private boolean applyLocalized;
186186

187187
/** The <code>Log</code> instance for this class. */
188188
private final Log log = LogFactory.getLog(LocaleConvertUtils.class);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class NestedTestBean {
3434

3535
private String testString = "NOT SET";
3636

37-
private boolean testBoolean = false;
37+
private boolean testBoolean;
3838

3939
private NestedTestBean indexedBeans[];
4040

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public static void incrementCounter(final Number amount) {
244244
* rules described in the JavaBeans Specification, this will be considered
245245
* a read-only boolean property, using isInvalidBoolean() as the getter.</p>
246246
*/
247-
private boolean invalidBoolean = false;
247+
private boolean invalidBoolean;
248248

249249
public TestBean() {
250250
listIndexed.add("String 0");

0 commit comments

Comments
 (0)