Skip to content

Commit 7ed14f1

Browse files
committed
Don't initialize instance variables to their default values
1 parent a620622 commit 7ed14f1

18 files changed

+32
-32
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private static Map<Object, Object> getDynaClassesMap() {
269269
/**
270270
* Name of the JavaBean class represented by this WrapDynaClass.
271271
*/
272-
private String beanClassName = null;
272+
private String beanClassName;
273273

274274
/**
275275
* Reference to the JavaBean class represented by this WrapDynaClass.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public abstract class AbstractConverter implements Converter {
7777
/**
7878
* The default value specified to our Constructor, if any.
7979
*/
80-
private Object defaultValue = null;
80+
private Object defaultValue;
8181

8282

8383
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static <T> T checkConversionResult(final Class<T> type, final Object res
7272
private final Log log = LogFactory.getLog(BaseLocaleConverter.class);
7373

7474
/** The default value specified to our Constructor, if any. */
75-
private Object defaultValue = null;
75+
private Object defaultValue;
7676

7777
/** Should we return the default value on conversion errors? */
7878
protected boolean useDefault = false;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ public static Test suite() {
5454
private long counter = 100000;
5555

5656
// DynaClass for inDyna and outDyna
57-
private DynaClass dynaClass = null;
57+
private DynaClass dynaClass;
5858

5959
// Input objects that have identical sets of properties and values.
60-
private BenchBean inBean = null;
61-
private DynaBean inDyna = null;
60+
private BenchBean inBean;
61+
private DynaBean inDyna;
6262
private Map<String, Object> inMap = null; // Map of Objects requiring no conversion
6363
private Map<String, String> inStrs = null; // Map of Strings requiring conversion
6464

6565
// Output objects that have identical sets of properties.
66-
private BenchBean outBean = null;
67-
private DynaBean outDyna = null;
66+
private BenchBean outBean;
67+
private DynaBean outDyna;
6868

6969
// BeanUtilsBean instance to be used
70-
private BeanUtilsBean bu = null;
70+
private BeanUtilsBean bu;
7171

7272

7373

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class IndexedPropertyTestCase {
4343
/**
4444
* The test bean for each test.
4545
*/
46-
private IndexedTestBean bean = null;
46+
private IndexedTestBean bean;
4747
private BeanUtilsBean beanUtilsBean;
4848
private PropertyUtilsBean propertyUtilsBean;
4949
private String[] testArray;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ public static Test suite() {
5353
private long counter = 100000;
5454

5555
// DynaClass for inDyna and outDyna
56-
private DynaClass dynaClass = null;
56+
private DynaClass dynaClass;
5757

5858
// Input objects that have identical sets of properties and values.
59-
private BenchBean inBean = null;
60-
private DynaBean inDyna = null;
59+
private BenchBean inBean;
60+
private DynaBean inDyna;
6161
private Map<String, Object> inMap = null;
6262

6363
// Output objects that have identical sets of properties.
64-
private BenchBean outBean = null;
65-
private DynaBean outDyna = null;
64+
private BenchBean outBean;
65+
private DynaBean outDyna;
6666

6767
// PropertyUtilsBean instance to be used
68-
private PropertyUtilsBean pu = null;
68+
private PropertyUtilsBean pu;
6969

7070

7171

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,24 +184,24 @@ public static void incrementCounter(final Number amount) {
184184
/**
185185
* A nested reference to another test bean (populated as needed).
186186
*/
187-
private TestBean nested = null;
187+
private TestBean nested;
188188

189189
/**
190190
* Another nested reference to another test bean,
191191
*/
192-
private TestBean anotherNested = null;
192+
private TestBean anotherNested;
193193

194194
/**
195195
* Another nested reference to another test bean,
196196
*/
197-
private DynaBean nestedDynaBean = null;
197+
private DynaBean nestedDynaBean;
198198

199-
private MappedTestBean mappedNested = null;
199+
private MappedTestBean mappedNested;
200200

201201
/**
202202
* A String property with an initial value of null.
203203
*/
204-
private String nullProperty = null;
204+
private String nullProperty;
205205

206206
/**
207207
* A read-only String property.

src/test/java/org/apache/commons/beanutils/bugs/Jira411TestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Jira411TestCase extends TestCase {
3030

3131
public class DummyBean {
3232

33-
private String imgLink = null;
33+
private String imgLink;
3434

3535
public String getImgLink() {
3636
return imgLink;

src/test/java/org/apache/commons/beanutils/converters/BigDecimalConverterTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static TestSuite suite() {
5151

5252
// ------------------------------------------------------------------------
5353

54-
private Converter converter = null;
54+
private Converter converter;
5555

5656
public BigDecimalConverterTestCase(final String name) {
5757
super(name);

src/test/java/org/apache/commons/beanutils/converters/BigIntegerConverterTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static TestSuite suite() {
3636

3737
// ------------------------------------------------------------------------
3838

39-
private Converter converter = null;
39+
private Converter converter;
4040

4141
// ------------------------------------------------------------------------
4242

0 commit comments

Comments
 (0)