summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-18 10:01:21 +0200
committerNoel Grandin <noel@peralex.com>2014-11-18 12:44:28 +0200
commit0063cf285696951e336b9cec1da8881997b286ce (patch)
treebe70dfd8127c35f9e4a6d18d4db459a587813bf4 /framework
parent250391009aec9930abcc57930ddd4b6f56f4df9c (diff)
java: make fields final where possible
found by PMD Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
Diffstat (limited to 'framework')
-rw-r--r--framework/qa/complex/XUserInputInterception/EventTest.java4
-rw-r--r--framework/qa/complex/accelerators/KeyMapping.java4
-rw-r--r--framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java2
-rw-r--r--framework/qa/complex/desktop/DesktopTerminate.java2
-rw-r--r--framework/qa/complex/framework/autosave/AutoSave.java2
-rw-r--r--framework/qa/complex/framework/autosave/ConfigHelper.java2
-rw-r--r--framework/qa/complex/framework/autosave/Protocol.java16
-rw-r--r--framework/qa/complex/framework/recovery/CrashThread.java4
-rw-r--r--framework/qa/complex/framework/recovery/KlickButtonThread.java6
-rw-r--r--framework/qa/complex/framework/recovery/RecoveryTest.java2
-rw-r--r--framework/qa/complex/imageManager/_XComponent.java10
-rw-r--r--framework/qa/complex/imageManager/_XImageManager.java2
-rw-r--r--framework/qa/complex/imageManager/_XInitialization.java2
-rw-r--r--framework/qa/complex/imageManager/_XUIConfiguration.java4
-rw-r--r--framework/qa/complex/imageManager/_XUIConfigurationPersistence.java4
15 files changed, 33 insertions, 33 deletions
diff --git a/framework/qa/complex/XUserInputInterception/EventTest.java b/framework/qa/complex/XUserInputInterception/EventTest.java
index 350a2216e5d1..0efb10c2dc9a 100644
--- a/framework/qa/complex/XUserInputInterception/EventTest.java
+++ b/framework/qa/complex/XUserInputInterception/EventTest.java
@@ -406,11 +406,11 @@ public class EventTest {
* represents an <CODE>EventType</CODE>
* @see EventTest.EventTriggerType
*/
- private int eventType = 0;
+ private final int eventType;
/**
* represents a <CODE>XModel</CODE> of a document
*/
- private XModel xModel = null;
+ private final XModel xModel;
/**
* Creates an instacne of this class. The parameter <CODE>eType</CODE> represents
diff --git a/framework/qa/complex/accelerators/KeyMapping.java b/framework/qa/complex/accelerators/KeyMapping.java
index 0eb23b08b452..79e562a39a0b 100644
--- a/framework/qa/complex/accelerators/KeyMapping.java
+++ b/framework/qa/complex/accelerators/KeyMapping.java
@@ -42,8 +42,8 @@ class CodeHashMap extends HashMap<Short,String>
public class KeyMapping
{
- private IdentifierHashMap aIdentifierHashMap;
- private CodeHashMap aCodeHashMap;
+ private final IdentifierHashMap aIdentifierHashMap;
+ private final CodeHashMap aCodeHashMap;
public KeyMapping()
{
diff --git a/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java b/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java
index d3430486560c..fa3a999ad25c 100644
--- a/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java
+++ b/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java
@@ -25,7 +25,7 @@ import com.sun.star.uno.UnoRuntime;
public class ContextMenuInterceptor implements XContextMenuInterceptor
{
- private com.sun.star.awt.XBitmap myBitmap;
+ private final com.sun.star.awt.XBitmap myBitmap;
public ContextMenuInterceptor(com.sun.star.awt.XBitmap aBitmap)
{
diff --git a/framework/qa/complex/desktop/DesktopTerminate.java b/framework/qa/complex/desktop/DesktopTerminate.java
index 82e753e71e31..347eb749b56f 100644
--- a/framework/qa/complex/desktop/DesktopTerminate.java
+++ b/framework/qa/complex/desktop/DesktopTerminate.java
@@ -38,7 +38,7 @@ public class DesktopTerminate
{
private XMultiServiceFactory xMSF;
- private int iOfficeCloseTime = 1000;
+ private final int iOfficeCloseTime = 1000;
/**
* Test if all available document types change the
diff --git a/framework/qa/complex/framework/autosave/AutoSave.java b/framework/qa/complex/framework/autosave/AutoSave.java
index 33effb441304..f2a937e0c67f 100644
--- a/framework/qa/complex/framework/autosave/AutoSave.java
+++ b/framework/qa/complex/framework/autosave/AutoSave.java
@@ -66,7 +66,7 @@ public class AutoSave
{
private XDispatch m_xAutoSave;
private URL m_aRegistration;
- private Protocol m_aLog;
+ private final Protocol m_aLog;
private AutoSaveListener(XMultiServiceFactory xSMGR ,
XDispatch xAutoSave,
diff --git a/framework/qa/complex/framework/autosave/ConfigHelper.java b/framework/qa/complex/framework/autosave/ConfigHelper.java
index 204be38935bc..3e7fc394fc19 100644
--- a/framework/qa/complex/framework/autosave/ConfigHelper.java
+++ b/framework/qa/complex/framework/autosave/ConfigHelper.java
@@ -27,7 +27,7 @@ import com.sun.star.util.*;
class ConfigHelper
{
- private XHierarchicalNameAccess m_xConfig = null;
+ private final XHierarchicalNameAccess m_xConfig;
public ConfigHelper(XComponentContext context,
diff --git a/framework/qa/complex/framework/autosave/Protocol.java b/framework/qa/complex/framework/autosave/Protocol.java
index ac2a61dce79b..6748fc3ad6b1 100644
--- a/framework/qa/complex/framework/autosave/Protocol.java
+++ b/framework/qa/complex/framework/autosave/Protocol.java
@@ -139,9 +139,9 @@ public class Protocol extends JComponent
* @member m_nWarnings count warnings in protocol
* @member m_nTestMarks count test marker in protocol
*/
- private int m_nMode ;
- private int m_nFilter ;
- private String m_sFileName ;
+ private final int m_nMode ;
+ private final int m_nFilter ;
+ private final String m_sFileName ;
private long m_nLine ;
private long m_nScope ;
private long m_nErrors ;
@@ -158,15 +158,15 @@ public class Protocol extends JComponent
private class ProtocolLine
{
/// the line number of this protocol line (size of the vector of all protocol lines cn be used to count such lines!)
- private long m_nLine;
+ private final long m_nLine;
/// deepness of the current scope
- private long m_nScope;
+ private final long m_nScope;
/// mark line as an error, warning, data entry ... (see const definitions before)
- private int m_nType;
+ private final int m_nType;
/// of course, we have to know the logged message too :-)
- private String m_sMessage;
+ private final String m_sMessage;
/// and it can be useful to know the current time, when this line was created
- private Timestamp m_aStamp;
+ private final Timestamp m_aStamp;
/** ctor for fast initializing of such line */
private ProtocolLine( long nLine ,
diff --git a/framework/qa/complex/framework/recovery/CrashThread.java b/framework/qa/complex/framework/recovery/CrashThread.java
index 437b1309605c..8a16f83c6aa5 100644
--- a/framework/qa/complex/framework/recovery/CrashThread.java
+++ b/framework/qa/complex/framework/recovery/CrashThread.java
@@ -33,8 +33,8 @@ import com.sun.star.util.XURLTransformer;
* is nopt longer available.
*/
public class CrashThread extends Thread {
- private XComponent xDoc = null;
- private XMultiServiceFactory msf = null;
+ private final XComponent xDoc;
+ private final XMultiServiceFactory msf;
public CrashThread(XComponent xDoc, XMultiServiceFactory msf) {
this.xDoc = xDoc;
diff --git a/framework/qa/complex/framework/recovery/KlickButtonThread.java b/framework/qa/complex/framework/recovery/KlickButtonThread.java
index e5683efc6b6d..0b7e2cef67b6 100644
--- a/framework/qa/complex/framework/recovery/KlickButtonThread.java
+++ b/framework/qa/complex/framework/recovery/KlickButtonThread.java
@@ -27,9 +27,9 @@ import util.UITools;
* is nopt longer available.
*/
public class KlickButtonThread extends Thread {
- private XWindow xWindow = null;
- private XMultiServiceFactory xMSF = null;
- private String buttonName = null;
+ private final XWindow xWindow;
+ private final XMultiServiceFactory xMSF;
+ private final String buttonName;
public KlickButtonThread(XMultiServiceFactory xMSF, XWindow xWindow, String buttonName) {
this.xWindow = xWindow;
diff --git a/framework/qa/complex/framework/recovery/RecoveryTest.java b/framework/qa/complex/framework/recovery/RecoveryTest.java
index cfb767790b6d..b85f519078f5 100644
--- a/framework/qa/complex/framework/recovery/RecoveryTest.java
+++ b/framework/qa/complex/framework/recovery/RecoveryTest.java
@@ -69,7 +69,7 @@ public class RecoveryTest extends ComplexTestCase {
* and the values are com sun.star.awt.Rectangle.
* @see com.sun.star.awt.Rectangle
*/
- private HashMap<String, Rectangle> windowsPosSize = new HashMap<String, Rectangle>();
+ private final HashMap<String, Rectangle> windowsPosSize = new HashMap<String, Rectangle>();
/**
* A function to tell the framework, which test functions are available.
diff --git a/framework/qa/complex/imageManager/_XComponent.java b/framework/qa/complex/imageManager/_XComponent.java
index 54ac164a6f34..8b7cdb5404e7 100644
--- a/framework/qa/complex/imageManager/_XComponent.java
+++ b/framework/qa/complex/imageManager/_XComponent.java
@@ -40,7 +40,7 @@ public class _XComponent {
private static XComponent oObj = null;
private XComponent altDispose = null;
- private TestParameters tEnv = null;
+ private final TestParameters tEnv;
private boolean listenerDisposed[] = new boolean[2];
private String[] Loutput = new String[2];
@@ -49,8 +49,8 @@ public class _XComponent {
* on <code>dispose</code> call.
*/
private class MyEventListener implements XEventListener {
- private int number = 0;
- private String message = null;
+ private final int number;
+ private final String message;
private MyEventListener(int number, String message) {
this.message = message;
this.number = number;
@@ -61,8 +61,8 @@ public class _XComponent {
}
}
- private XEventListener listener1 = new MyEventListener(0, "EV1");
- private XEventListener listener2 = new MyEventListener(1, "EV2");
+ private final XEventListener listener1 = new MyEventListener(0, "EV1");
+ private final XEventListener listener2 = new MyEventListener(1, "EV2");
public _XComponent(TestParameters tEnv, XComponent oObj) {
this.tEnv = tEnv;
diff --git a/framework/qa/complex/imageManager/_XImageManager.java b/framework/qa/complex/imageManager/_XImageManager.java
index 96ea2a3f9ead..42d8055c4679 100644
--- a/framework/qa/complex/imageManager/_XImageManager.java
+++ b/framework/qa/complex/imageManager/_XImageManager.java
@@ -31,7 +31,7 @@ public class _XImageManager {
private String[]imageNames = null;
private XGraphic[] xGraphicArray = null;
- private XImageManager oObj;
+ private final XImageManager oObj;
public _XImageManager( TestParameters tEnv, XImageManager oObj) {
this.oObj = oObj;
diff --git a/framework/qa/complex/imageManager/_XInitialization.java b/framework/qa/complex/imageManager/_XInitialization.java
index fce31d4a3835..14cab34d4ca0 100644
--- a/framework/qa/complex/imageManager/_XInitialization.java
+++ b/framework/qa/complex/imageManager/_XInitialization.java
@@ -40,7 +40,7 @@ import lib.TestParameters;
public class _XInitialization {
- private TestParameters tEnv = null;
+ private final TestParameters tEnv;
private static XInitialization oObj = null;
public _XInitialization(TestParameters tEnv, XInitialization oObj) {
diff --git a/framework/qa/complex/imageManager/_XUIConfiguration.java b/framework/qa/complex/imageManager/_XUIConfiguration.java
index b3076c6077d1..486989535c5e 100644
--- a/framework/qa/complex/imageManager/_XUIConfiguration.java
+++ b/framework/qa/complex/imageManager/_XUIConfiguration.java
@@ -28,8 +28,8 @@ import lib.TestParameters;
public class _XUIConfiguration {
- private TestParameters tEnv = null;
- private XUIConfiguration oObj;
+ private final TestParameters tEnv;
+ private final XUIConfiguration oObj;
private XUIConfigurationListenerImpl xListener = null;
public interface XUIConfigurationListenerImpl
diff --git a/framework/qa/complex/imageManager/_XUIConfigurationPersistence.java b/framework/qa/complex/imageManager/_XUIConfigurationPersistence.java
index aa00c59b57c7..23735a1797bc 100644
--- a/framework/qa/complex/imageManager/_XUIConfigurationPersistence.java
+++ b/framework/qa/complex/imageManager/_XUIConfigurationPersistence.java
@@ -27,8 +27,8 @@ import lib.TestParameters;
public class _XUIConfigurationPersistence {
- private TestParameters tEnv = null;
- private XUIConfigurationPersistence oObj;
+ private final TestParameters tEnv;
+ private final XUIConfigurationPersistence oObj;
private XStorage xStore = null;
public _XUIConfigurationPersistence(TestParameters tEnv, XUIConfigurationPersistence oObj) {