You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/10/27 15:04:07 UTC
(commons-scxml) 01/04: Don't initialize an instance or static variable to its default value
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-scxml.git
commit bc4d80360b49b53ab24e48741223633232d556d2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Oct 27 10:58:57 2023 -0400
Don't initialize an instance or static variable to its default value
---
checkstyle.xml | 1 +
src/main/java/org/apache/commons/scxml2/SCXMLExecutionContext.java | 2 +-
src/main/java/org/apache/commons/scxml2/env/URLResolver.java | 2 +-
src/test/java/org/apache/commons/scxml2/model/Hello.java | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/checkstyle.xml b/checkstyle.xml
index b9970e9..0087e4f 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -102,6 +102,7 @@
<module name="TreeWalker">
+ <module name="ExplicitInitializationCheck" />
<property name="cacheFile" value="${checkstyle.cache.file}" />
<!-- Checks for Javadoc comments. -->
diff --git a/src/main/java/org/apache/commons/scxml2/SCXMLExecutionContext.java b/src/main/java/org/apache/commons/scxml2/SCXMLExecutionContext.java
index 72917c0..0b7aefb 100644
--- a/src/main/java/org/apache/commons/scxml2/SCXMLExecutionContext.java
+++ b/src/main/java/org/apache/commons/scxml2/SCXMLExecutionContext.java
@@ -87,7 +87,7 @@ public class SCXMLExecutionContext implements SCXMLIOProcessor {
/**
* The environment specific error reporter.
*/
- private ErrorReporter errorReporter = null;
+ private ErrorReporter errorReporter;
/**
* The notification registry.
diff --git a/src/main/java/org/apache/commons/scxml2/env/URLResolver.java b/src/main/java/org/apache/commons/scxml2/env/URLResolver.java
index 71f867a..d3f6205 100644
--- a/src/main/java/org/apache/commons/scxml2/env/URLResolver.java
+++ b/src/main/java/org/apache/commons/scxml2/env/URLResolver.java
@@ -38,7 +38,7 @@ public class URLResolver implements PathResolver, Serializable {
private static final Log log = LogFactory.getLog(PathResolver.class);
/** The base URL to resolve against. */
- private URL baseURL = null;
+ private URL baseURL;
/**
* Constructor.
diff --git a/src/test/java/org/apache/commons/scxml2/model/Hello.java b/src/test/java/org/apache/commons/scxml2/model/Hello.java
index 66d8298..a51bf12 100644
--- a/src/test/java/org/apache/commons/scxml2/model/Hello.java
+++ b/src/test/java/org/apache/commons/scxml2/model/Hello.java
@@ -28,7 +28,7 @@ public class Hello extends Action {
/** This is who we say hello to. */
private String name;
/** We count callbacks to execute() as part of the test suite. */
- public static int callbacks = 0;
+ public static int callbacks;
/** Public constructor is needed for the I in SCXML IO. */
public Hello() {