Skip to content

Commit 09d2d23

Browse files
committed
Don't initial instance variable to its default value
1 parent 9498000 commit 09d2d23

20 files changed

+36
-34
lines changed

checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<module name="FileTabCharacterCheck" />
4646

4747
<module name="TreeWalker">
48-
48+
<module name="ExplicitInitialization" />
4949
<!--property name="cacheFile" value="${checkstyle.cache.file}"/ -->
5050

5151
<!-- ************************************************************** -->

src/main/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public class JXPathBasicBeanInfo implements JXPathBeanInfo {
3737
private static final long serialVersionUID = -3863803443111484155L;
3838
private static final Comparator PROPERTY_DESCRIPTOR_COMPARATOR = (left, right) -> ((PropertyDescriptor) left).getName()
3939
.compareTo(((PropertyDescriptor) right).getName());
40-
private boolean atomic = false;
40+
41+
private boolean atomic;
4142
private final Class clazz;
4243
private Class dynamicPropertyHandlerClass;
4344
private transient PropertyDescriptor[] propertyDescriptors;

src/main/java/org/apache/commons/jxpath/JXPathContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ public static JXPathContext newContext(final Object contextBean) {
428428
/** Decimal format map */
429429
protected HashMap<String, DecimalFormatSymbols> decimalFormats;
430430
private Locale locale;
431-
private boolean lenientSet = false;
432-
private boolean lenient = false;
431+
private boolean lenientSet;
432+
private boolean lenient;
433433

434434
/**
435435
* This constructor should remain protected - it is to be overridden by subclasses, but never explicitly invoked by clients.

src/main/java/org/apache/commons/jxpath/JXPathContextFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public abstract class JXPathContextFactory {
4949
/**
5050
* Temp debug code - this will be removed after we test everything
5151
*/
52-
private static boolean debug = false;
52+
private static boolean debug;
53+
5354
static {
5455
try {
5556
debug = System.getProperty("jxpath.debug") != null;

src/main/java/org/apache/commons/jxpath/ri/EvalContext.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public abstract class EvalContext implements ExpressionContext, Iterator {
4747
/** Root context */
4848
protected RootContext rootContext;
4949
/** Position */
50-
protected int position = 0;
51-
private boolean startedSetIteration = false;
52-
private boolean done = false;
53-
private boolean hasPerformedIteratorStep = false;
50+
protected int position;
51+
private boolean startedSetIteration;
52+
private boolean done;
53+
private boolean hasPerformedIteratorStep;
5454
private Iterator<Pointer> pointerIterator;
5555

5656
/**

src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public class JXPathContextReferenceImpl extends JXPathContext {
6666
public static final boolean USE_SOFT_CACHE = true;
6767
private static final Compiler COMPILER = new TreeCompiler();
6868
private static Map compiled = new HashMap();
69-
private static int cleanupCount = 0;
70-
private static NodePointerFactory[] nodeFactoryArray = null;
69+
private static int cleanupCount;
70+
private static NodePointerFactory[] nodeFactoryArray;
7171
// The frequency of the cache cleanup
7272
private static final int CLEANUP_THRESHOLD = 500;
7373
private static final Vector<NodePointerFactory> nodeFactories = new Vector<>();

src/main/java/org/apache/commons/jxpath/ri/compiler/Expression.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void remove() {
121121
protected static final Double ONE = Double.valueOf(1);
122122
/** NaN */
123123
protected static final Double NOT_A_NUMBER = Double.valueOf(Double.NaN);
124-
private boolean contextDependencyKnown = false;
124+
private boolean contextDependencyKnown;
125125
private boolean contextDependent;
126126

127127
/**

src/main/java/org/apache/commons/jxpath/ri/compiler/ExpressionPath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class ExpressionPath extends Path {
3333

3434
private final Expression expression;
3535
private final Expression[] predicates;
36-
private boolean basicKnown = false;
36+
private boolean basicKnown;
3737
private boolean basic;
3838

3939
/**

src/main/java/org/apache/commons/jxpath/ri/compiler/Path.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
public abstract class Path extends Expression {
4242

4343
private final Step[] steps;
44-
private boolean basicKnown = false;
44+
private boolean basicKnown;
4545
private boolean basic;
4646

4747
/**

src/main/java/org/apache/commons/jxpath/ri/model/NodePointer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static NodePointer verify(final NodePointer nodePointer) {
138138

139139
/** Index for this NodePointer */
140140
protected int index = WHOLE_COLLECTION;
141-
private boolean attribute = false;
141+
private boolean attribute;
142142
private NamespaceResolver namespaceResolver;
143143
private ExceptionHandler exceptionHandler;
144144
private transient Object rootNode;

0 commit comments

Comments
 (0)