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 /qadevOOo/runner | |
parent | 250391009aec9930abcc57930ddd4b6f56f4df9c (diff) |
java: make fields final where possible
found by PMD
Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
Diffstat (limited to 'qadevOOo/runner')
44 files changed, 112 insertions, 119 deletions
diff --git a/qadevOOo/runner/base/java_cmp.java b/qadevOOo/runner/base/java_cmp.java index bb94269f985d..86927bc598d6 100644 --- a/qadevOOo/runner/base/java_cmp.java +++ b/qadevOOo/runner/base/java_cmp.java @@ -28,7 +28,7 @@ package base; */ public class java_cmp implements TestBase { - private TestBase mWrappedTestBase = new java_fat(); + private final TestBase mWrappedTestBase = new java_fat(); public boolean executeTest(lib.TestParameters param) { param.put("OfficeProvider", "helper.UnoProvider"); diff --git a/qadevOOo/runner/complexlib/MethodThread.java b/qadevOOo/runner/complexlib/MethodThread.java index 11bdcb61ded1..d30df06609f8 100644 --- a/qadevOOo/runner/complexlib/MethodThread.java +++ b/qadevOOo/runner/complexlib/MethodThread.java @@ -29,11 +29,11 @@ public class MethodThread extends Thread { /** The method that should be executed **/ - private Method mTestMethod = null; + private final Method mTestMethod; /** The object that implements the method **/ - private Object mInvokeClass = null; + private final Object mInvokeClass; /** A PrintWriter for debug Output **/ - private PrintWriter mLog = null; + private final PrintWriter mLog; /** An Error String **/ private String mErrMessage = null; /** Did an Exception happen? **/ diff --git a/qadevOOo/runner/convwatch/BorderRemover.java b/qadevOOo/runner/convwatch/BorderRemover.java index af7ee46a99bc..dbd933b3ad35 100644 --- a/qadevOOo/runner/convwatch/BorderRemover.java +++ b/qadevOOo/runner/convwatch/BorderRemover.java @@ -26,10 +26,10 @@ import java.lang.reflect.Method; class Rect { - private int x; - private int y; - private int w; - private int h; + private final int x; + private final int y; + private final int w; + private final int h; public Rect(int _x, int _y, int _w, int _h) { diff --git a/qadevOOo/runner/convwatch/DBHelper.java b/qadevOOo/runner/convwatch/DBHelper.java index 03128eafa0ba..dc76af3ad9d2 100644 --- a/qadevOOo/runner/convwatch/DBHelper.java +++ b/qadevOOo/runner/convwatch/DBHelper.java @@ -49,8 +49,8 @@ class ShareConnection class MySQLThread extends Thread { - private Connection m_aCon = null; - private String m_sSQL; + private final Connection m_aCon; + private final String m_sSQL; public MySQLThread(Connection _aCon, String _sSQL) { m_aCon = _aCon; diff --git a/qadevOOo/runner/convwatch/DirectoryHelper.java b/qadevOOo/runner/convwatch/DirectoryHelper.java index 26cd831a7042..9d322c52fb5e 100644 --- a/qadevOOo/runner/convwatch/DirectoryHelper.java +++ b/qadevOOo/runner/convwatch/DirectoryHelper.java @@ -27,7 +27,7 @@ import java.util.ArrayList; */ public class DirectoryHelper { - private ArrayList<String> m_aFileList = new ArrayList<String>(); + private final ArrayList<String> m_aFileList = new ArrayList<String>(); private boolean m_bRecursiveIsAllowed = true; private void setRecursiveIsAllowed(boolean _bValue) diff --git a/qadevOOo/runner/convwatch/GraphicalTestArguments.java b/qadevOOo/runner/convwatch/GraphicalTestArguments.java index e4dd7c0b6028..d5cc3c4f5800 100644 --- a/qadevOOo/runner/convwatch/GraphicalTestArguments.java +++ b/qadevOOo/runner/convwatch/GraphicalTestArguments.java @@ -81,15 +81,15 @@ public class GraphicalTestArguments private boolean m_bIncludeSubdirectories; - private TestParameters m_aCurrentParams; + private final TestParameters m_aCurrentParams; - private int m_nMaxPages = 0; // default is 0 (print all pages) - private String m_sOnlyPage = ""; // default is "", there is no page which we want to print only. + private final int m_nMaxPages; // default is 0 (print all pages) + private final String m_sOnlyPage; // default is "", there is no page which we want to print only. private int m_nResolutionInDPI = 0; private boolean m_bStoreFile = true; - private boolean m_bResuseOffice = false; + private final boolean m_bResuseOffice; diff --git a/qadevOOo/runner/convwatch/ImageHelper.java b/qadevOOo/runner/convwatch/ImageHelper.java index 2644223e2ebb..5723c3fc85fb 100644 --- a/qadevOOo/runner/convwatch/ImageHelper.java +++ b/qadevOOo/runner/convwatch/ImageHelper.java @@ -26,9 +26,9 @@ import java.lang.reflect.Method; class ImageHelper { - private Image m_aImage; - private int[] m_aPixels; - private int m_w = 0; + private final Image m_aImage; + private final int[] m_aPixels; + private final int m_w; private ImageHelper(Image _aImage) diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java index 8e1747bf1308..08e9629883ad 100644 --- a/qadevOOo/runner/convwatch/IniFile.java +++ b/qadevOOo/runner/convwatch/IniFile.java @@ -32,9 +32,9 @@ class IniFile * internal representation of the ini file content. * Problem, if ini file changed why other write something difference, we don't realise this. */ - private String m_sFilename; - private ArrayList<String> m_aList; - private boolean m_bListContainUnsavedChanges = false; + private final String m_sFilename; + private final ArrayList<String> m_aList; + private final boolean m_bListContainUnsavedChanges = false; /** open a ini file by its name diff --git a/qadevOOo/runner/convwatch/PRNCompare.java b/qadevOOo/runner/convwatch/PRNCompare.java index bc542752cc2b..1dac4c8eed97 100644 --- a/qadevOOo/runner/convwatch/PRNCompare.java +++ b/qadevOOo/runner/convwatch/PRNCompare.java @@ -30,7 +30,7 @@ import java.util.ArrayList; public class PRNCompare { - private String fs; + private final String fs; public PRNCompare() { diff --git a/qadevOOo/runner/convwatch/TriState.java b/qadevOOo/runner/convwatch/TriState.java index c72e06c2b913..ec9dfd194336 100644 --- a/qadevOOo/runner/convwatch/TriState.java +++ b/qadevOOo/runner/convwatch/TriState.java @@ -24,7 +24,7 @@ public class TriState public static final TriState FALSE = new TriState(0); public static final TriState UNSET = new TriState(-1); - private int m_nValue; + private final int m_nValue; /** Allocates a <code>TriState</code> object representing the diff --git a/qadevOOo/runner/graphical/DirectoryHelper.java b/qadevOOo/runner/graphical/DirectoryHelper.java index 6ba7e6cdfdd6..0d0462795433 100644 --- a/qadevOOo/runner/graphical/DirectoryHelper.java +++ b/qadevOOo/runner/graphical/DirectoryHelper.java @@ -27,7 +27,7 @@ import java.util.ArrayList; */ public class DirectoryHelper { - private ArrayList<String> m_aFileList = new ArrayList<String>(); + private final ArrayList<String> m_aFileList = new ArrayList<String>(); private boolean m_bRecursiveIsAllowed = true; private void setRecursiveIsAllowed(boolean _bValue) diff --git a/qadevOOo/runner/graphical/ImageHelper.java b/qadevOOo/runner/graphical/ImageHelper.java index 8f4249697192..f625b3d95cff 100644 --- a/qadevOOo/runner/graphical/ImageHelper.java +++ b/qadevOOo/runner/graphical/ImageHelper.java @@ -26,9 +26,9 @@ import java.lang.reflect.Method; class ImageHelper { - private Image m_aImage; - private int[] m_aPixels; - private int m_w = 0; + private final Image m_aImage; + private final int[] m_aPixels; + private final int m_w; private ImageHelper(Image _aImage) diff --git a/qadevOOo/runner/graphical/IniFile.java b/qadevOOo/runner/graphical/IniFile.java index fe2df6e62878..cc82ce4c86db 100644 --- a/qadevOOo/runner/graphical/IniFile.java +++ b/qadevOOo/runner/graphical/IniFile.java @@ -35,8 +35,8 @@ public class IniFile implements Enumeration<String> * internal representation of the ini file content. * Problem, if ini file changed why other write something difference, we don't realise this. */ - private String m_sFilename; - private ArrayList<String> m_aList; + private final String m_sFilename; + private final ArrayList<String> m_aList; private boolean m_bListContainUnsavedChanges = false; private int m_aEnumerationPos = 0; diff --git a/qadevOOo/runner/graphical/JPEGComparator.java b/qadevOOo/runner/graphical/JPEGComparator.java index f793b527e607..4d07a03d3428 100644 --- a/qadevOOo/runner/graphical/JPEGComparator.java +++ b/qadevOOo/runner/graphical/JPEGComparator.java @@ -88,7 +88,7 @@ class NameDPIPage class CountNotXXXPixelsFromImage extends Thread { - private String m_sFilename; + private final String m_sFilename; protected int m_nValue; CountNotXXXPixelsFromImage(String _sFilename) diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java index a5c1667e7eb1..ba9a7ba25c64 100644 --- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java @@ -32,12 +32,6 @@ import helper.OSHelper; * *.xls as excel * *.ppt as powerpoint */ - -//class ProcessHelper -//{ -// ArrayList m_aArray; -//} - public class MSOfficePostscriptCreator implements IOffice { private String m_sPrinterName; // within Windows the tools need a printer name; @@ -47,11 +41,10 @@ public class MSOfficePostscriptCreator implements IOffice m_sPrinterName = _s; } - private ParameterHelper m_aParameterHelper; + private final ParameterHelper m_aParameterHelper; private String m_sDocumentName; - private String m_sResult; + private final String m_sResult; - // CTor public MSOfficePostscriptCreator(ParameterHelper _aParam, String _sResult) { m_aParameterHelper = _aParam; diff --git a/qadevOOo/runner/graphical/Office.java b/qadevOOo/runner/graphical/Office.java index 0cba0f63fd70..85785b2f3dad 100644 --- a/qadevOOo/runner/graphical/Office.java +++ b/qadevOOo/runner/graphical/Office.java @@ -22,9 +22,9 @@ import java.util.ArrayList; public class Office implements IOffice { - private ParameterHelper m_aParameterHelper; + private final ParameterHelper m_aParameterHelper; private String m_sDocumentName; - private String m_sResult; + private final String m_sResult; private IOffice m_aOffice = null; public Office(ParameterHelper _aParam, String _sResult) diff --git a/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java b/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java index 96a6d0a69f77..199b169c88af 100644 --- a/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java +++ b/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java @@ -81,7 +81,7 @@ class PropertySetHelper public class OpenOfficeDatabaseReportExtractor extends Assurance { - private ParameterHelper m_aParameterHelper; + private final ParameterHelper m_aParameterHelper; public OpenOfficeDatabaseReportExtractor(ParameterHelper _aParameter) { diff --git a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java index cd0dde453ade..dfbdfd8a648c 100644 --- a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java @@ -50,8 +50,8 @@ import java.io.File; */ public class OpenOfficePostscriptCreator implements IOffice { - private ParameterHelper m_aParameterHelper; - private String m_sOutputURL; + private final ParameterHelper m_aParameterHelper; + private final String m_sOutputURL; private String m_sBasename; private String m_sDocumentName; private XComponent m_aDocument; diff --git a/qadevOOo/runner/graphical/ParameterHelper.java b/qadevOOo/runner/graphical/ParameterHelper.java index 0f3c06d8aa83..2c9e95217ed9 100644 --- a/qadevOOo/runner/graphical/ParameterHelper.java +++ b/qadevOOo/runner/graphical/ParameterHelper.java @@ -67,12 +67,12 @@ public class ParameterHelper private String m_sPrinterName = null; - private int m_nResolutionInDPI = 180; + private final int m_nResolutionInDPI = 180; private String m_sInputPath = null; private String m_sOutputPath = null; - private TestParameters m_aCurrentParams; + private final TestParameters m_aCurrentParams; public ParameterHelper(TestParameters param) { diff --git a/qadevOOo/runner/graphical/Tolerance.java b/qadevOOo/runner/graphical/Tolerance.java index 80857168de7d..647dfb750760 100644 --- a/qadevOOo/runner/graphical/Tolerance.java +++ b/qadevOOo/runner/graphical/Tolerance.java @@ -20,7 +20,7 @@ package graphical; public class Tolerance { - private int m_nTolerance; + private final int m_nTolerance; public Tolerance(int _nAccept) { m_nTolerance = _nAccept; diff --git a/qadevOOo/runner/helper/BuildEnvTools.java b/qadevOOo/runner/helper/BuildEnvTools.java index 3cd50a823397..826832276683 100644 --- a/qadevOOo/runner/helper/BuildEnvTools.java +++ b/qadevOOo/runner/helper/BuildEnvTools.java @@ -35,7 +35,7 @@ public class BuildEnvTools { private final boolean mDebug; private final String mPlatform; private final String mShell; - private boolean mCygwin; + private final boolean mCygwin; /** * This constructor creates an instance of BuildEncTools. It is verifying for all neccesarry diff --git a/qadevOOo/runner/helper/ConfigHelper.java b/qadevOOo/runner/helper/ConfigHelper.java index d0fd6c9839c5..2adadaf2e146 100644 --- a/qadevOOo/runner/helper/ConfigHelper.java +++ b/qadevOOo/runner/helper/ConfigHelper.java @@ -85,7 +85,7 @@ import com.sun.star.util.*; */ public class ConfigHelper { - private XHierarchicalNameAccess m_xConfig = null; + private final XHierarchicalNameAccess m_xConfig; public ConfigHelper(XMultiServiceFactory xSMGR , diff --git a/qadevOOo/runner/helper/LoggingThread.java b/qadevOOo/runner/helper/LoggingThread.java index 9869e7885b9d..590a467a7134 100644 --- a/qadevOOo/runner/helper/LoggingThread.java +++ b/qadevOOo/runner/helper/LoggingThread.java @@ -36,10 +36,10 @@ import util.utils; */ public class LoggingThread extends Thread { - private TestParameters param; - private LogWriter log = null; + private final TestParameters param; + private final LogWriter log; private boolean finished = false; - private boolean debug = false; + private final boolean debug; public LoggingThread(LogWriter log, TestParameters tParam) { this.log = log; diff --git a/qadevOOo/runner/helper/OfficeWatcher.java b/qadevOOo/runner/helper/OfficeWatcher.java index 624e5c0238d1..60900c0052bd 100644 --- a/qadevOOo/runner/helper/OfficeWatcher.java +++ b/qadevOOo/runner/helper/OfficeWatcher.java @@ -24,14 +24,14 @@ import util.utils; public class OfficeWatcher extends Thread implements share.Watcher { public boolean finish; - private TestParameters params; + private final TestParameters params; private int StoredPing = 0; - private boolean debug = false; + private final boolean debug; public OfficeWatcher(TestParameters param) { - finish = false; + this.finish = false; this.params = param; - debug = params.getBool(util.PropertyName.DEBUG_IS_ACTIVE); + this.debug = params.getBool(util.PropertyName.DEBUG_IS_ACTIVE); } /** diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java index fb3ff77e8f28..332eb52f5a83 100644 --- a/qadevOOo/runner/helper/ProcessHandler.java +++ b/qadevOOo/runner/helper/ProcessHandler.java @@ -43,11 +43,11 @@ import util.utils; class Pump extends Thread { - private LineNumberReader reader; - private String pref; - private StringBuffer buf = new StringBuffer(256); - private PrintWriter log; - private boolean bOutput; + private final LineNumberReader reader; + private final String pref; + private final StringBuffer buf = new StringBuffer(256); + private final PrintWriter log; + private final boolean bOutput; /** * Creates Pump for specified <code>InputStream</code>. @@ -782,8 +782,8 @@ public class ProcessHandler { private int m_nTimeoutInSec; - private String m_sProcessToStart; - private boolean m_bInterrupt; + private final String m_sProcessToStart; + private final boolean m_bInterrupt; private ProcessWatcher(int _nTimeOut, String _sProcess) { diff --git a/qadevOOo/runner/lib/MultiMethodTest.java b/qadevOOo/runner/lib/MultiMethodTest.java index 0493b4bbf37e..c1f0b308f07b 100644 --- a/qadevOOo/runner/lib/MultiMethodTest.java +++ b/qadevOOo/runner/lib/MultiMethodTest.java @@ -95,7 +95,7 @@ public class MultiMethodTest /** * Contains names of the methods have been already called */ - private ArrayList<String> methCalled = new ArrayList<String>(10); + private final ArrayList<String> methCalled = new ArrayList<String>(10); /** * Disposes the test environment, which was corrupted by the test. diff --git a/qadevOOo/runner/lib/StatusException.java b/qadevOOo/runner/lib/StatusException.java index a4bf07f4703f..328fc4ff1899 100644 --- a/qadevOOo/runner/lib/StatusException.java +++ b/qadevOOo/runner/lib/StatusException.java @@ -27,7 +27,7 @@ public class StatusException extends RuntimeException { /** * The Status contained in the StatusException. */ - private Status status; + private final Status status; /** * Constructs a StatusException containing an exception Status. diff --git a/qadevOOo/runner/lib/TestParameters.java b/qadevOOo/runner/lib/TestParameters.java index 69bf9fcd2980..abd1dc29097b 100644 --- a/qadevOOo/runner/lib/TestParameters.java +++ b/qadevOOo/runner/lib/TestParameters.java @@ -51,7 +51,7 @@ public class TestParameters extends HashMap<String,Object> { * Debug information will always be written on standard out.<br> * default is true */ - private boolean DebugIsActive = false; + private final boolean DebugIsActive = false; /** * Wrapper around "get()" with some debug output diff --git a/qadevOOo/runner/stats/DataBaseOutProducer.java b/qadevOOo/runner/stats/DataBaseOutProducer.java index 6ffe9b705c39..f362d7e7e498 100644 --- a/qadevOOo/runner/stats/DataBaseOutProducer.java +++ b/qadevOOo/runner/stats/DataBaseOutProducer.java @@ -24,7 +24,7 @@ import java.util.HashMap; public abstract class DataBaseOutProducer implements LogWriter { protected HashMap<String,Object> mSqlInput = null; - private HashMap<String, String[]> mSqlOutput = null; + private final HashMap<String, String[]> mSqlOutput = null; private String[] mWriteableEntryTypes = null; private SQLExecution mSqlExec; protected boolean m_bDebug = false; diff --git a/qadevOOo/runner/stats/SQLExecution.java b/qadevOOo/runner/stats/SQLExecution.java index 34f8949b7772..487716c0e8c6 100644 --- a/qadevOOo/runner/stats/SQLExecution.java +++ b/qadevOOo/runner/stats/SQLExecution.java @@ -35,10 +35,10 @@ public class SQLExecution { private Connection mConnection = null; private Statement mStatement = null; - private String mJdbcClass = null; - private String mDbURL = null; - private String mUser = null; - private String mPassword = null; + private final String mJdbcClass; + private final String mDbURL; + private final String mUser; + private final String mPassword; private boolean m_bConnectionOpen = false; private boolean m_bDebug = false; diff --git a/qadevOOo/runner/util/ControlDsc.java b/qadevOOo/runner/util/ControlDsc.java index e5eb0d2ea62b..736fe01b0351 100644 --- a/qadevOOo/runner/util/ControlDsc.java +++ b/qadevOOo/runner/util/ControlDsc.java @@ -28,7 +28,7 @@ import com.sun.star.uno.UnoRuntime; public class ControlDsc extends InstDescr { - private String name = null; + private String name; static final String ifcName = "com.sun.star.form.XFormComponent"; String service = "com.sun.star.form.component.CommandButton"; diff --git a/qadevOOo/runner/util/DBTools.java b/qadevOOo/runner/util/DBTools.java index f6e7c815bc81..15aa1d926514 100644 --- a/qadevOOo/runner/util/DBTools.java +++ b/qadevOOo/runner/util/DBTools.java @@ -41,8 +41,8 @@ import java.sql.DriverManager; */ public class DBTools { - private XMultiServiceFactory xMSF = null ; - private XNamingService dbContext = null ; + private final XMultiServiceFactory xMSF; + private XNamingService dbContext; //JDBC driver public final static String TST_JDBC_DRIVER = "org.gjt.mm.mysql.Driver"; @@ -122,7 +122,7 @@ public class DBTools { /** * Representation of <code>'SuppressVersionColumns'</code> property. */ - private Boolean SuppressVersionColumns = null ; + private Boolean SuppressVersionColumns; /** * Representation of <code>'IsReadOnly'</code> property. */ diff --git a/qadevOOo/runner/util/DefaultDsc.java b/qadevOOo/runner/util/DefaultDsc.java index 8090fad5c2a2..9c270007c76d 100644 --- a/qadevOOo/runner/util/DefaultDsc.java +++ b/qadevOOo/runner/util/DefaultDsc.java @@ -23,14 +23,13 @@ import com.sun.star.uno.XInterface; import com.sun.star.uno.UnoRuntime; /** - * Defaultdescriptor: * This descriptor is useful for instances in default values. */ public class DefaultDsc extends InstDescr { - private String name = null; - private String ifcName = null; - private String service = null; + private final String name = null; + private final String ifcName; + private final String service; public DefaultDsc( String Interface, String kind ) { service = kind; diff --git a/qadevOOo/runner/util/InstCreator.java b/qadevOOo/runner/util/InstCreator.java index e1eb8c86ffcf..de40b07c03b1 100644 --- a/qadevOOo/runner/util/InstCreator.java +++ b/qadevOOo/runner/util/InstCreator.java @@ -31,11 +31,11 @@ import com.sun.star.container.XIndexAccess; public class InstCreator implements XInstCreator { - private XInterface xParent; - private XMultiServiceFactory xMSF; - private XInterface xInstance; - private XIndexAccess xIA; - private InstDescr iDsc; + private final XInterface xParent; + private final XMultiServiceFactory xMSF; + private final XInterface xInstance; + private final XIndexAccess xIA; + private final InstDescr iDsc; public InstCreator( XInterface xParent, InstDescr iDsc ) { this.xParent = xParent; diff --git a/qadevOOo/runner/util/SOfficeFactory.java b/qadevOOo/runner/util/SOfficeFactory.java index c45fbd6131e0..0150e3c035cb 100644 --- a/qadevOOo/runner/util/SOfficeFactory.java +++ b/qadevOOo/runner/util/SOfficeFactory.java @@ -42,7 +42,7 @@ import com.sun.star.drawing.*; public class SOfficeFactory { private static HashMap<String, SOfficeFactory> lookup = new HashMap<String, SOfficeFactory>(10); - private XComponentLoader oCLoader; + private final XComponentLoader oCLoader; private SOfficeFactory(XMultiServiceFactory xMSF) { // get XInterface of Desktop service diff --git a/qadevOOo/runner/util/ShapeDsc.java b/qadevOOo/runner/util/ShapeDsc.java index 9610c3dabdb5..99fdaea84fc8 100644 --- a/qadevOOo/runner/util/ShapeDsc.java +++ b/qadevOOo/runner/util/ShapeDsc.java @@ -28,22 +28,23 @@ import com.sun.star.awt.*; */ public class ShapeDsc extends InstDescr { - private int x = 0; - private int y = 0; - private int height = 0; - private int width = 0; - private String name = null; + private final int x; + private final int y; + private final int height; + private final int width; + private final String name = null; private static final String ifcName = "com.sun.star.drawing.XShape"; - private String service = "com.sun.star.drawing.RectangleShape"; + private final String service; - public ShapeDsc( int nheight, int nwidth, int nx, int ny, String kind ) { - x=nx; - y=ny; - height=nheight; - width=nwidth; - service="com.sun.star.drawing."+kind+"Shape"; + public ShapeDsc(int nheight, int nwidth, int nx, int ny, String kind) { + x = nx; + y = ny; + height = nheight; + width = nwidth; + service = "com.sun.star.drawing." + kind + "Shape"; initShape(); } + @Override public String getName() { return name; diff --git a/qadevOOo/runner/util/StyleFamilyDsc.java b/qadevOOo/runner/util/StyleFamilyDsc.java index c3cf2baae49b..daef8b563401 100644 --- a/qadevOOo/runner/util/StyleFamilyDsc.java +++ b/qadevOOo/runner/util/StyleFamilyDsc.java @@ -27,7 +27,7 @@ import com.sun.star.uno.UnoRuntime; */ public class StyleFamilyDsc extends InstDescr { - private String name = null; + private String name; static final String ifcName = "com.sun.star.style.XStyle"; String service = "com.sun.star.style.CharacterStyle"; diff --git a/qadevOOo/runner/util/XLayerHandlerImpl.java b/qadevOOo/runner/util/XLayerHandlerImpl.java index 2f7dcaf50857..399db9a24358 100644 --- a/qadevOOo/runner/util/XLayerHandlerImpl.java +++ b/qadevOOo/runner/util/XLayerHandlerImpl.java @@ -20,7 +20,7 @@ package util; public class XLayerHandlerImpl implements com.sun.star.configuration.backend.XLayerHandler { private String calls = ""; - private String ls = System.getProperty("line.separator"); + private final String ls = System.getProperty("line.separator"); public void addOrReplaceNode(String str, short param) throws com.sun.star.configuration.backend.MalformedDataException, diff --git a/qadevOOo/runner/util/XMLTools.java b/qadevOOo/runner/util/XMLTools.java index 64330a10bbf6..bc989da981e6 100644 --- a/qadevOOo/runner/util/XMLTools.java +++ b/qadevOOo/runner/util/XMLTools.java @@ -42,8 +42,8 @@ public class XMLTools { public String Type ; public String Value ; } - private HashMap<String, Attribute> attrByName = new HashMap<String, Attribute>() ; - private ArrayList<Attribute> attributes = new ArrayList<Attribute>() ; + private final HashMap<String, Attribute> attrByName = new HashMap<String, Attribute>() ; + private final ArrayList<Attribute> attributes = new ArrayList<Attribute>() ; private PrintWriter log = null ; /** @@ -342,8 +342,8 @@ public class XMLTools { * appropriate message is output. */ public static class XMLTagsChecker extends XMLWellFormChecker { - private HashMap<String,String> tags = new HashMap<String,String>() ; - private HashMap<String,String> chars = new HashMap<String,String>() ; + private final HashMap<String,String> tags = new HashMap<String,String>() ; + private final HashMap<String,String> chars = new HashMap<String,String>() ; private boolean allOK = true ; public XMLTagsChecker(PrintWriter log) { @@ -455,7 +455,7 @@ public class XMLTools { * name, or attribute value additionally. */ public static class Tag { - private String name = null; + private final String name; private String[][] attrList = new String[0][3] ; /** @@ -594,11 +594,11 @@ public class XMLTools { * character data exists inside any tag specified. */ public static class XMLChecker extends XMLWellFormChecker { - private HashSet<String> tagSet = new HashSet<String>() ; - private ArrayList<Tag[]> tags = new ArrayList<Tag[]>() ; - private ArrayList<Object[]> chars = new ArrayList<Object[]>() ; - private ArrayList<String> tagStack = new ArrayList<String>() ; - private ArrayList<AttributeList> attrStack = new ArrayList<AttributeList>() ; + private final HashSet<String> tagSet = new HashSet<String>() ; + private final ArrayList<Tag[]> tags = new ArrayList<Tag[]>() ; + private final ArrayList<Object[]> chars = new ArrayList<Object[]>() ; + private final ArrayList<String> tagStack = new ArrayList<String>() ; + private final ArrayList<AttributeList> attrStack = new ArrayList<AttributeList>() ; public XMLChecker(PrintWriter log, boolean writeXML) { super(log, writeXML) ; diff --git a/qadevOOo/runner/util/XSchemaHandlerImpl.java b/qadevOOo/runner/util/XSchemaHandlerImpl.java index 06758014bbc7..cd72fd6ed11d 100644 --- a/qadevOOo/runner/util/XSchemaHandlerImpl.java +++ b/qadevOOo/runner/util/XSchemaHandlerImpl.java @@ -20,7 +20,7 @@ package util; public class XSchemaHandlerImpl implements com.sun.star.configuration.backend.XSchemaHandler { private String calls = ""; - private String ls = System.getProperty("line.separator"); + private final String ls = System.getProperty("line.separator"); public void addInstance(String str, com.sun.star.configuration.backend.TemplateIdentifier templateIdentifier) diff --git a/qadevOOo/runner/util/compare/GraphicalComparator.java b/qadevOOo/runner/util/compare/GraphicalComparator.java index 82495a8a9a7d..3e91dd04d280 100644 --- a/qadevOOo/runner/util/compare/GraphicalComparator.java +++ b/qadevOOo/runner/util/compare/GraphicalComparator.java @@ -29,7 +29,7 @@ import convwatch.ConvWatchException; class GraphicalComparator implements DocComparator { - private GraphicalTestArguments m_aArguments; + private final GraphicalTestArguments m_aArguments; protected GraphicalComparator(TestParameters aParams) { diff --git a/qadevOOo/runner/util/db/DataSource.java b/qadevOOo/runner/util/db/DataSource.java index 0ee1775f5be7..5e54a625e9ac 100644 --- a/qadevOOo/runner/util/db/DataSource.java +++ b/qadevOOo/runner/util/db/DataSource.java @@ -138,8 +138,8 @@ public class DataSource } } - private XMultiServiceFactory m_orb = null; - private XDataSource m_dataSource = null; - private XPropertySet m_properties = null; + private final XMultiServiceFactory m_orb; + private final XDataSource m_dataSource; + private final XPropertySet m_properties; private DatabaseDocument m_document = null; } diff --git a/qadevOOo/runner/util/db/DataSourceDescriptor.java b/qadevOOo/runner/util/db/DataSourceDescriptor.java index 6aa9a8f6c28b..f4de986eab7c 100644 --- a/qadevOOo/runner/util/db/DataSourceDescriptor.java +++ b/qadevOOo/runner/util/db/DataSourceDescriptor.java @@ -60,5 +60,5 @@ public class DataSourceDescriptor return new DataSource( m_orb, this ); } - private XMultiServiceFactory m_orb = null; + private final XMultiServiceFactory m_orb; } diff --git a/qadevOOo/runner/util/db/DatabaseDocument.java b/qadevOOo/runner/util/db/DatabaseDocument.java index d620a8248b70..4b8228f316a1 100644 --- a/qadevOOo/runner/util/db/DatabaseDocument.java +++ b/qadevOOo/runner/util/db/DatabaseDocument.java @@ -72,8 +72,8 @@ public class DatabaseDocument m_storeDoc.storeAsURL( _url, new PropertyValue[] { } ); } - private DataSource m_dataSource; - private XOfficeDatabaseDocument m_databaseDocument; - private XModel m_model; - private XStorable m_storeDoc; + private final DataSource m_dataSource; + private final XOfficeDatabaseDocument m_databaseDocument; + private final XModel m_model; + private final XStorable m_storeDoc; } |