Skip to content
Permalink
Browse files
Add final modifier to private fields.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/digester/trunk@1806245 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
garydgregory committed Aug 25, 2017
1 parent 0b2a0c2 commit 23cc0ea22911ad746259b61589f7a75a4e34d4ab
Show file tree
Hide file tree
Showing 27 changed files with 44 additions and 44 deletions.
@@ -156,7 +156,7 @@
* The decision algorithm used (unfortunately) doesn't preserve the entry order. This map is used by a comparator
* which orders the list of matches before it's returned. This map stores the entry number keyed by the rule.
*/
private Map<Rule, Integer> order = new HashMap<Rule, Integer>();
private final Map<Rule, Integer> order = new HashMap<Rule, Integer>();

// --------------------------------------------------------- Public Methods

@@ -43,7 +43,7 @@
// ----------------------------------------------------------- Fields

/** Should exceptions thrown by the factory be ignored? */
private boolean ignoreCreateExceptions;
private final boolean ignoreCreateExceptions;

/** Stock to manage */
private Stack<Boolean> exceptionIgnoredStack;
@@ -32,7 +32,7 @@

private final String pattern;

private String namespaceURI;
private final String namespaceURI;

public PatternRuleMatcher( String pattern )
{
@@ -43,7 +43,7 @@
// --------------------------------------------------------- Fields

/** All registered <code>Rule</code>'s */
private ArrayList<RegisteredRule> registeredRules = new ArrayList<RegisteredRule>();
private final ArrayList<RegisteredRule> registeredRules = new ArrayList<RegisteredRule>();

/** The regex strategy used by this RegexRules */
private RegexMatcher matcher;
@@ -108,7 +108,7 @@

private boolean allowUnknownChildElements = false;

private HashMap<String, String> elementNames = new HashMap<String, String>();
private final HashMap<String, String> elementNames = new HashMap<String, String>();

// ----------------------------------------------------------- Constructors

@@ -334,9 +334,9 @@ public String toString()

private Rules decoratedRules = null;

private ArrayList<Rule> rules = new ArrayList<Rule>( 1 );
private final ArrayList<Rule> rules = new ArrayList<Rule>( 1 );

private AnyChildRule rule;
private final AnyChildRule rule;

public AnyChildRules( AnyChildRule rule )
{
@@ -62,13 +62,13 @@
// --------------------------------------------------------- Fields

/** The Rules implementation that this class wraps. */
private Rules wrappedRules;
private final Rules wrappedRules;

/** Rules to be fired when the wrapped implementations returns none. */
private List<Rule> defaultRules = new ArrayList<Rule>();
private final List<Rule> defaultRules = new ArrayList<Rule>();

/** All rules (preserves order in which they were originally added) */
private List<Rule> allRules = new ArrayList<Rule>();
private final List<Rule> allRules = new ArrayList<Rule>();

// --------------------------------------------------------- Constructor

@@ -37,13 +37,13 @@
private Class<?> pluginClass;

/** The name of the class of the object to be instantiated. */
private String pluginClassName;
private final String pluginClassName;

/** See {@link #setId}. */
private String id;

/** See {@link #setProperties}. */
private Properties properties = new Properties();
private final Properties properties = new Properties();

/** See {@link #init}. */
private boolean initialized = false;
@@ -39,18 +39,18 @@
{

/** Map of classname->Declaration */
private HashMap<String, Declaration> declarationsByClass = new HashMap<String, Declaration>();
private final HashMap<String, Declaration> declarationsByClass = new HashMap<String, Declaration>();

/** Map of id->Declaration */
private HashMap<String, Declaration> declarationsById = new HashMap<String, Declaration>();
private final HashMap<String, Declaration> declarationsById = new HashMap<String, Declaration>();

/** the parent manager to which this one may delegate lookups. */
private PluginManager parent;

/**
* The object containing data that should only exist once for each Digester instance.
*/
private PluginContext pluginContext;
private final PluginContext pluginContext;

// ------------------- constructors ---------------------------------------

@@ -65,7 +65,7 @@
private Rules decoratedRules;

/** Object which contains information about all known plugins. */
private PluginManager pluginManager;
private final PluginManager pluginManager;

/**
* The path below which this rules object has responsibility. For paths shorter than or equal the mountpoint, the
@@ -35,7 +35,7 @@
{

// list of mapped attributes.
private ArrayList<String> values = new ArrayList<String>( 10 );
private final ArrayList<String> values = new ArrayList<String>( 10 );

private Attributes attrs;

@@ -28,7 +28,7 @@
{
private String id;

private List<Box> children = new LinkedList<Box>();
private final List<Box> children = new LinkedList<Box>();

public Box()
{
@@ -39,7 +39,7 @@ public Employee( String firstName, String lastName )
setLastName( lastName );
}

private ArrayList<Address> addresses = new ArrayList<Address>();
private final ArrayList<Address> addresses = new ArrayList<Address>();

public void addAddress( Address address )
{
@@ -42,7 +42,7 @@

// ------------------------------------------------ Individual Test Methods

private StringBuilder sb =
private final StringBuilder sb =
new StringBuilder().append( "<arraylist><A/><B/><C/><D desc=\"the fourth\"/><E/></arraylist>" );

/**
@@ -130,7 +130,7 @@ public void setIntArray( int intArray[] )
this.intArray = intArray;
}

private int intIndexed[] = { 0, 10, 20, 30, 40 };
private final int intIndexed[] = { 0, 10, 20, 30, 40 };

public int getIntIndexed( int index )
{
@@ -272,7 +272,7 @@ public void setStringArray( String stringArray[] )
this.stringArray = stringArray;
}

private String stringIndexed[] = { "String 0", "String 1", "String 2", "String 3", "String 4" };
private final String stringIndexed[] = { "String 0", "String 1", "String 2", "String 3", "String 4" };

public String getStringIndexed( int index )
{
@@ -40,7 +40,7 @@
// ----------------------------------------------------- Instance Variables

/** String identifing this particular <code>TestRule</code> */
private String identifier;
private final String identifier;

/** Used when testing body text */
private String bodyText;
@@ -49,7 +49,7 @@
public final class BinderClassLoaderTestCase
{

private BinderClassLoader classLoader = createBinderClassLoader( new ExtendedClassLoader() );
private final BinderClassLoader classLoader = createBinderClassLoader( new ExtendedClassLoader() );

@Test
public void loadBoolean()
@@ -24,7 +24,7 @@
public class Container
implements Widget
{
private LinkedList<Widget> children = new LinkedList<Widget>();
private final LinkedList<Widget> children = new LinkedList<Widget>();

public Container()
{
@@ -219,9 +219,9 @@ public void testInstanceOverride()

public static class MultiContainer
{
private LinkedList<Widget> widgets = new LinkedList<Widget>();
private final LinkedList<Widget> widgets = new LinkedList<Widget>();

private LinkedList<Widget> gadgets = new LinkedList<Widget>();
private final LinkedList<Widget> gadgets = new LinkedList<Widget>();

public MultiContainer()
{
@@ -37,15 +37,15 @@
extends Substitutor
{

private String newBodyText;
private final String newBodyText;

private String uri;
private final String uri;

private String localName;
private final String localName;

private String type;
private final String type;

private String value;
private final String value;

public SubstitutorStub( String bodyText, String uri, String localName, String type, String value )
{
@@ -45,7 +45,7 @@
// --------------------------------------------------- Overall Test Methods

// method used in tests4
private LinkedList<SimpleTestBean> simpleTestBeans = new LinkedList<SimpleTestBean>();
private final LinkedList<SimpleTestBean> simpleTestBeans = new LinkedList<SimpleTestBean>();

public void addSimpleTestBean( SimpleTestBean bean )
{
@@ -54,7 +54,7 @@ public void addSimpleTestBean( SimpleTestBean bean )

// implementation of source shared by the variable expander and
// is updatable during digesting via an Ant-like property element
private HashMap<String, Object> mutableSource = new HashMap<String, Object>();
private final HashMap<String, Object> mutableSource = new HashMap<String, Object>();

/**
* Used in test case "testExpansionWithMutableSource", where the set of variables available to be substituted into
@@ -31,7 +31,7 @@
public class DigesterPatternStackTest
{

private PatternStack patternStack = new PatternStack();
private final PatternStack patternStack = new PatternStack();

@Before
public void setUp()
@@ -31,15 +31,15 @@
public class ObjectTestImpl
{

private ArrayList<Object> children = new ArrayList<Object>();
private final ArrayList<Object> children = new ArrayList<Object>();

private String value = "";

private Long longValue = new Long( -1L );

private String property = "";

private HashMap<String, String> mapValue = new HashMap<String, String>();
private final HashMap<String, String> mapValue = new HashMap<String, String>();

private boolean pushed = false;

@@ -24,7 +24,7 @@
implements Item
{

private String isbn;
private final String isbn;

private String title;

@@ -37,7 +37,7 @@
*/
public static class Column
{
private String name, value;
private final String name, value;

public Column( String name, String value )
{
@@ -56,7 +56,7 @@ public String getValue()
}
}

private LinkedList<Column> columns = new LinkedList<Column>();
private final LinkedList<Column> columns = new LinkedList<Column>();

public Row()
{
@@ -29,7 +29,7 @@
extends Rule
{

private Connection conn;
private final Connection conn;

public RowInserterRule( Connection conn )
{
@@ -34,7 +34,7 @@
implements Transform
{

private LinkedList<Transform> transforms = new LinkedList<Transform>();
private final LinkedList<Transform> transforms = new LinkedList<Transform>();

public void addTransform( Transform transform )
{
@@ -33,9 +33,9 @@

private String name;

private HashMap<String, String> emails = new HashMap<String, String>();
private final HashMap<String, String> emails = new HashMap<String, String>();

private List<Address> addresses = new ArrayList<Address>();
private final List<Address> addresses = new ArrayList<Address>();

/**
* A unique id for this person. Note that the Digester automatically converts the id to an integer.

0 comments on commit 23cc0ea

Please sign in to comment.