diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-18 10:01:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-18 12:44:28 +0200 |
commit | 0063cf285696951e336b9cec1da8881997b286ce (patch) | |
tree | be70dfd8127c35f9e4a6d18d4db459a587813bf4 /xmerge/source | |
parent | 250391009aec9930abcc57930ddd4b6f56f4df9c (diff) |
java: make fields final where possible
found by PMD
Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
Diffstat (limited to 'xmerge/source')
23 files changed, 49 insertions, 49 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java index 122bffd94d07..8d0eb79b38ca 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java @@ -38,16 +38,16 @@ import org.openoffice.xmerge.util.registry.ConverterInfo; public class Convert implements Cloneable { /** ConvertInfo that corresponds to the from-mime/to-mime conversion. */ - private ConverterInfo ci; + private final ConverterInfo ci; /** * {@code true} if converting to the Office format, {@code false} if * converting to the device format. */ - private boolean toOffice; + private final boolean toOffice; /** Holds the convert input data. */ - private ConvertData inputCD = new ConvertData(); + private final ConvertData inputCD = new ConvertData(); /** * Construct a Convert class with specified {@code ConvertInfo} registry diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java index b355298a3b15..8641417b1cf7 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/ConvertData.java @@ -33,7 +33,7 @@ public class ConvertData { /** * Vector of {@code Document} objects. */ - private ArrayList<Object> v = new ArrayList<Object>(); + private final ArrayList<Object> v = new ArrayList<Object>(); /** * Name of the {@code ConvertData} object. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/PluginFactory.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/PluginFactory.java index c00a21b50523..cb2e07a4a788 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/PluginFactory.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/PluginFactory.java @@ -69,7 +69,7 @@ public abstract class PluginFactory { /** * Cached {@code ConvertInfo} object. */ - private ConverterInfo ciCache; + private final ConverterInfo ciCache; /** * Constructor that caches the {@code ConvertInfo} that corresponds to the diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java index f3f68045afe4..0d166aac4004 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java @@ -44,10 +44,10 @@ import java.util.Date; public final class PdbEncoder { /** PDB header. */ - private PdbHeader header = null; + private final PdbHeader header; /** the PalmDB object. */ - private PalmDB db = null; + private final PalmDB db; /** The pattern for unique_id=0x00BABE(start). */ private final static int START_UNIQUE_ID = 0x00BABE; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java index 3bfaf3cb8404..fdbbbffd319f 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java @@ -49,7 +49,7 @@ class OfficeZip { private final static int BUFFERSIZE = 1024; - private List<Entry> entryList = null; + private final List<Entry> entryList; private int contentIndex = -1; private int styleIndex = -1; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java index 3faeb876fd14..2163fc658b96 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/ParaStyle.java @@ -156,7 +156,7 @@ public class ParaStyle extends Style implements Cloneable { /** Array of attribute values for this paragraph {@code Style}. */ private int value[] = new int[NR_PROPERTIES]; /** Array of attribute names for this paragraph {@code Style}. */ - private String attrName[] = { + private final String attrName[] = { "fo:margin-left", "fo:margin-right", "fo:margin-top", @@ -167,7 +167,7 @@ public class ParaStyle extends Style implements Cloneable { }; /** Array of attribute structures for this paragraph {@code Style}. */ - private Class<?> algor[] = { + private final Class<?> algor[] = { horizSize.class, horizSize.class, horizSize.class, diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java index 5c34c0ef9c36..f08d664d9a3d 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/StyleCatalog.java @@ -39,7 +39,7 @@ import org.w3c.dom.NodeList; */ public class StyleCatalog { - private ArrayList<Style> styles; // The actual styles + private final ArrayList<Style> styles; // The actual styles /** * Constructor. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/DocumentMergerImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/DocumentMergerImpl.java index 04eebc081663..33cab9fd8f87 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/DocumentMergerImpl.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/DocumentMergerImpl.java @@ -48,8 +48,8 @@ import org.openoffice.xmerge.util.Debug; */ public class DocumentMergerImpl implements DocumentMerger { - private ConverterCapabilities cc_; - private org.openoffice.xmerge.Document orig = null; + private final ConverterCapabilities cc_; + private final org.openoffice.xmerge.Document orig; /** * Constructor. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java index 0675e5805102..9d6ddbc6ee1a 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentDeserializer.java @@ -59,7 +59,7 @@ public abstract class SxcDocumentDeserializer implements OfficeConstants, private org.w3c.dom.Document doc = null; /** A {@code ConvertData} object assigned to this object. */ - private ConvertData cd = null; + private final ConvertData cd ; /** A {@code StyleCatalog} for the workbook. */ private StyleCatalog styleCat = null; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java index b29e89fd44f2..ed7012d76cf2 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentDeserializerImpl.java @@ -54,8 +54,8 @@ public final class DocumentDeserializerImpl implements DocumentDeserializer,URIResolver { /** A {@code ConvertData} object assigned to this object. */ - private ConvertData cd = null; - private PluginFactoryImpl pluginFactory = null; + private final ConvertData cd; + private final PluginFactoryImpl pluginFactory; /** * Constructor that assigns the given {@code ConvertData} to this object. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentMergerImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentMergerImpl.java index da0d308d463b..a4bcd770ddb0 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentMergerImpl.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentMergerImpl.java @@ -39,8 +39,8 @@ import org.openoffice.xmerge.util.Debug; */ public class DocumentMergerImpl implements DocumentMerger { - private ConverterCapabilities cc_; - private org.openoffice.xmerge.Document orig = null; + private final ConverterCapabilities cc_; + private final org.openoffice.xmerge.Document orig; public DocumentMergerImpl(org.openoffice.xmerge.Document doc, ConverterCapabilities cc) { cc_ = cc; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java index 6c238db82fa1..988909c51f79 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/DocumentSerializerImpl.java @@ -61,9 +61,9 @@ public final class DocumentSerializerImpl implements DocumentSerializer,OfficeConstants,URIResolver { /** SXW {@code Document} object that this converter processes. */ - private GenericOfficeDocument sxwDoc = null; + private final GenericOfficeDocument sxwDoc; - private PluginFactoryImpl pluginFactory = null; + private final PluginFactoryImpl pluginFactory; /** * Constructor. @@ -72,7 +72,7 @@ public final class DocumentSerializerImpl * @param doc A SXW {@code Document} to be converted. */ public DocumentSerializerImpl(PluginFactoryImpl pf,Document doc) { - pluginFactory=pf; + pluginFactory=pf; sxwDoc = (GenericOfficeDocument) doc; } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java index b24c2c78379d..b797f3a865f6 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/Difference.java @@ -39,7 +39,7 @@ public final class Difference { public static final int UNCHANGE = 4; /** The action of the diff - either {@link #ADD} or {@link #DELETE} */ - private int operation; + private final int operation; /** * The position of the content that should be operated on (original @@ -99,14 +99,14 @@ public final class Difference { * <diff orgPos=4 modPos=2 operation=DELETE> <-- element E * <diff orgPos=5 modPos=2 operation=DELETE> <-- element F}</pre></blockquote> */ - private int orgPosition; + private final int orgPosition; /** * The position of the content that should be operated (modified iterator). * * <p>For explanation and examples, see {@link #orgPosition}</p>. */ - private int modPosition; + private final int modPosition; /** * Constructor. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java index 8b634ae821c1..9603d0ed9853 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharacterParser.java @@ -42,9 +42,9 @@ import java.util.List; */ public class CharacterParser { - private TextNodeIterator textNodes; + private final TextNodeIterator textNodes; private int currentPosition = 0; - private List<TextNodeEntry> nodeList_ = null; + private final List<TextNodeEntry> nodeList_; private char[] charArray; /** diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java index ed34c337f1ac..6a3768065722 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/NodeIterator.java @@ -45,8 +45,8 @@ public abstract class NodeIterator implements Iterator { private List<Node> nodeList = null; private int currentPosition = 0; - private Node root; - private ConverterCapabilities cc_ = null; + private final Node root; + private final ConverterCapabilities cc_; /** * Standard constructor. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeEntry.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeEntry.java index ebe234fdadf7..cbfb9e93fc8d 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeEntry.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeEntry.java @@ -29,9 +29,9 @@ import org.w3c.dom.Node; */ public class TextNodeEntry { - private int startChar_; - private int endChar_; - private Node node_; + private final int startChar_; + private final int endChar_; + private final Node node_; /** * Constructor diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java index 1d37e4cabd5f..2c208dba0528 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java @@ -39,7 +39,7 @@ import org.openoffice.xmerge.util.XmlUtil; */ public class DocumentMerge implements MergeAlgorithm { - private NodeMergeAlgorithm subDocumentMerge = null; + private final NodeMergeAlgorithm subDocumentMerge; /** The capabilities of this converter. */ protected ConverterCapabilities cc_; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java index 491f1ac13ac4..afc03935e8d7 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/PositionBaseRowMerge.java @@ -39,7 +39,7 @@ import org.openoffice.xmerge.util.XmlUtil; public final class PositionBaseRowMerge implements NodeMergeAlgorithm { /** The capabilities of this converter. */ - private ConverterCapabilities cc_; + private final ConverterCapabilities cc_; /** * Constructor. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java index 2f87d2b8e1de..f83b43b6668b 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java @@ -51,10 +51,10 @@ public final class Driver { private String mergeFile = null; /** Command-line parmeter. */ - private ArrayList<String> deviceFiles = new ArrayList<String>(); + private final ArrayList<String> deviceFiles = new ArrayList<String>(); /** Command-line parmeter shortcuts. */ - private String mimeTypes[] = { + private final String mimeTypes[] = { "sxc", "staroffice/sxc", "sxw","staroffice/sxw" }; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java index eb2388a9440d..414655770848 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/IntArrayList.java @@ -26,7 +26,7 @@ import java.util.ArrayList; public class IntArrayList { /** The list to hold our integers. */ - private ArrayList<Integer> list; + private final ArrayList<Integer> list; /** * Constructor. diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Resources.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Resources.java index ddcdb148579d..aa7dd7c10de4 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Resources.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/Resources.java @@ -36,7 +36,7 @@ import java.util.ResourceBundle; */ public final class Resources { - private ResourceBundle rb = null; + private final ResourceBundle rb; private static Resources instance = null; /** diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java index 14e036687828..192777bd50b1 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java @@ -41,20 +41,20 @@ public class ConverterInfo { "staroffice/sxc" }; - private String piJarName; - private String piOfficeMime; - private ArrayList<String> piDeviceMime; - private String piDisplayName; - private String piDescription; - private String piVersion; - private String piVendor; - private String piClassImpl; + private final String piJarName; + private final String piOfficeMime; + private final ArrayList<String> piDeviceMime; + private final String piDisplayName; + private final String piDescription; + private final String piVersion; + private final String piVendor; + private final String piClassImpl; private String piXsltSerial; private String piXsltDeserial; private boolean piCanSerialize = false; private boolean piCanDeserialize = false; private boolean piCanMerge = false; - private ClassLoader piClassLoader = null; + private final ClassLoader piClassLoader; private PluginFactory piPluginFactory; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java index 411b5b005560..476f047c0d8d 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java @@ -45,9 +45,9 @@ public class ConverterInfoReader { private final static String ATTRIB_DEVICE_TYPE = "type"; private final static String TAG_XSLT_DESERIAL = "converter-xslt-deserialize"; private final static String TAG_XSLT_SERIAL = "converter-xslt-serialize"; - private String jarfilename; - private Document document; - private ArrayList<ConverterInfo> converterInfoList; + private final String jarfilename; + private final Document document; + private final ArrayList<ConverterInfo> converterInfoList; /** * Constructor. |