summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-17 11:35:04 +0200
committerNoel Grandin <noel@peralex.com>2014-12-19 10:41:58 +0200
commit2d82619a528ebdf867f242c85ad626462609ba39 (patch)
tree4653347d1e28bb02a723be5c58b744d277e6697f /qadevOOo
parent0ae24c2189ea68576c96fcbe87299b51256cb468 (diff)
java: static fields that should not be static
Found by FindBugs. Change-Id: I223841f7bb8c515c9612322abc0b13e134385abd
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/runner/base/java_fat.java8
-rw-r--r--qadevOOo/runner/complexlib/ComplexTestCase.java4
-rw-r--r--qadevOOo/runner/stats/InternalLogWriter.java34
-rw-r--r--qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java4
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XComponent.java2
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java3
-rw-r--r--qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java2
-rw-r--r--qadevOOo/tests/java/ifc/table/_XCellCursor.java5
-rw-r--r--qadevOOo/tests/java/ifc/text/_NumberingLevel.java10
-rw-r--r--qadevOOo/tests/java/mod/_acceptor/Acceptor.java2
10 files changed, 30 insertions, 44 deletions
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java
index 04f159a4336a..c9891d4c9f09 100644
--- a/qadevOOo/runner/base/java_fat.java
+++ b/qadevOOo/runner/base/java_fat.java
@@ -45,10 +45,10 @@ import com.sun.star.lang.XMultiServiceFactory;
public class java_fat implements TestBase
{
- private static boolean m_isDebug = false;
- private static boolean keepdocument = false;
- private static boolean logging = true;
- private static boolean newOffice = false;
+ private boolean m_isDebug = false;
+ private boolean keepdocument = false;
+ private boolean logging = true;
+ private boolean newOffice = false;
private DynamicClassLoader m_aDynamicClassLoader = null;
private lib.TestParameters m_aParams;
diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java
index 2486692130bb..3e940749b1bf 100644
--- a/qadevOOo/runner/complexlib/ComplexTestCase.java
+++ b/qadevOOo/runner/complexlib/ComplexTestCase.java
@@ -32,9 +32,9 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
{
/** The test parameters **/
- protected static TestParameters param = null;
+ protected TestParameters param = null;
/** Log writer **/
- protected static LogWriter log = null;
+ protected LogWriter log = null;
/**
* The method name which will be written into f.e. the data base
**/
diff --git a/qadevOOo/runner/stats/InternalLogWriter.java b/qadevOOo/runner/stats/InternalLogWriter.java
index d9a0a2de067c..a39e372a61cc 100644
--- a/qadevOOo/runner/stats/InternalLogWriter.java
+++ b/qadevOOo/runner/stats/InternalLogWriter.java
@@ -24,18 +24,18 @@ import java.io.StringWriter;
* Write all logs into a java.io.PrintWriter, i.e. a StringBuffer.
* Log is gathered there.
*/
-public class InternalLogWriter extends PrintWriter
- implements share.LogWriter {
+public class InternalLogWriter implements share.LogWriter {
/** log active **/
private boolean active;
/** write all output to a StringBuffer **/
- private static StringWriter writer = new StringWriter();
+ private StringWriter writer = new StringWriter();
+ private PrintWriter printWriter;
/**
* c'*tor
*/
public InternalLogWriter() {
- super(new PrintWriter(writer));
+ printWriter = new PrintWriter(writer);
active = true;
}
@@ -54,21 +54,9 @@ public class InternalLogWriter extends PrintWriter
* Method to print a line that is added to the StringBuffer.
* @param msg The message that is printed.
*/
- @Override
public void println(String msg) {
if (active)
- super.println(msg);
- }
-
- /**
- * Method to print to the StringBuffer.
- * @param msg The message that is printed.
- */
- @Override
- public void print(String msg) {
- if (active)
- super.print(msg);
-
+ printWriter.println(msg);
}
/**
@@ -80,17 +68,17 @@ public class InternalLogWriter extends PrintWriter
public boolean summary(share.DescEntry entry) {
// linePrefix = "";
String header = "***** State for "+entry.longName+" ******";
- println(header);
+ printWriter.println(header);
if (entry.hasErrorMsg) {
- println(entry.ErrorMsg);
- println("Whole "+entry.EntryType+": "+entry.State);
+ printWriter.println(entry.ErrorMsg);
+ printWriter.println("Whole "+entry.EntryType+": "+entry.State);
} else {
- println("Whole "+entry.EntryType+": "+entry.State);
+ printWriter.println("Whole "+entry.EntryType+": "+entry.State);
}
for (int i=0;i<header.length();i++) {
- print("*");
+ printWriter.print("*");
}
- println("");
+ printWriter.println("");
return true;
}
diff --git a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
index 02c41b583378..b2b3ff3bb4ca 100644
--- a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
@@ -29,8 +29,8 @@ import com.sun.star.uno.UnoRuntime;
public class _XEventBroadcaster extends MultiMethodTest {
public XEventBroadcaster oObj;
- protected static boolean listenerCalled=false;
- private static XEventListener listener=null;
+ protected boolean listenerCalled = false;
+ private XEventListener listener = null;
public class MyEventListener implements XEventListener {
diff --git a/qadevOOo/tests/java/ifc/lang/_XComponent.java b/qadevOOo/tests/java/ifc/lang/_XComponent.java
index 184f6ccad2ab..c05b7c5deffe 100644
--- a/qadevOOo/tests/java/ifc/lang/_XComponent.java
+++ b/qadevOOo/tests/java/ifc/lang/_XComponent.java
@@ -113,7 +113,7 @@ public class _XComponent extends MultiMethodTest {
log.println(Thread.currentThread() + " is removing EL " + listener2);
} // finished _removeEventListener()
- static boolean disposed = false;
+ boolean disposed = false;
/**
* Disposes the object and then check appropriate listeners were
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java b/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java
index 41f093f72c17..0fb7e4f883b0 100644
--- a/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java
@@ -33,14 +33,13 @@ import lib.MultiMethodTest;
public class _XAvailableLocales extends MultiMethodTest {
public XAvailableLocales oObj = null;
- public static Locale[] locales = new Locale[0];
/**
* Test calls the method, stores returned value and checks it. <p>
* Has <b> OK </b> status if length of returned array isn't zero. <p>
*/
public void _getAvailableLocales() {
- locales = oObj.getAvailableLocales("com.sun.star.linguistic2.Hyphenator");
+ Locale[] locales = oObj.getAvailableLocales("com.sun.star.linguistic2.Hyphenator");
tRes.tested("getAvailableLocales()", locales.length > 0);
}
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java b/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
index b70eecffd721..269e07c8ac15 100644
--- a/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
@@ -35,7 +35,7 @@ import com.sun.star.linguistic2.XSupportedLocales;
public class _XSupportedLocales extends MultiMethodTest {
public XSupportedLocales oObj = null;
- public static Locale[] locales = new Locale[0];
+ public Locale[] locales = new Locale[0];
/**
* Test calls the method, stores returned value and checks it. <p>
diff --git a/qadevOOo/tests/java/ifc/table/_XCellCursor.java b/qadevOOo/tests/java/ifc/table/_XCellCursor.java
index 9c2591f91c42..a01c4667c5b1 100644
--- a/qadevOOo/tests/java/ifc/table/_XCellCursor.java
+++ b/qadevOOo/tests/java/ifc/table/_XCellCursor.java
@@ -54,8 +54,7 @@ import com.sun.star.uno.UnoRuntime;
*/
public class _XCellCursor extends MultiMethodTest {
- public static XCellCursor oObj = null;
- public static XSpreadsheet oSheet = null;
+ public XCellCursor oObj = null;
/**
* <code>XCellRangeAddressable</code> interface is queried
@@ -174,7 +173,7 @@ public class _XCellCursor extends MultiMethodTest {
*/
public void _gotoEnd(){
//gotoEnd gets it's own cursor to see a change
- oSheet = (XSpreadsheet) tEnv.getObjRelation("SHEET");
+ XSpreadsheet oSheet = (XSpreadsheet) tEnv.getObjRelation("SHEET");
XCellRange testRange = oSheet.getCellRangeByName("$A$1:$g$7") ;
XSheetCellRange testSheetRange = UnoRuntime.queryInterface(XSheetCellRange.class,testRange);
XSheetCellCursor oCellCursor = oSheet.createCursorByRange
diff --git a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
index bc9a59442146..a23c7fbcb150 100644
--- a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
+++ b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
@@ -64,9 +64,9 @@ import com.sun.star.beans.PropertyValue;
*/
public class _NumberingLevel {
- private static HashMap<String, Boolean> NumberingLevel = new HashMap<String,Boolean>();
- private static PropertyValue[] PropertyArray = null;
- private static LogWriter log = null;
+ private HashMap<String, Boolean> NumberingLevel = new HashMap<String,Boolean>();
+ private PropertyValue[] PropertyArray = null;
+ private LogWriter log = null;
/**
@@ -77,9 +77,9 @@ public class _NumberingLevel {
*/
public _NumberingLevel(LogWriter log, TestParameters tParam, PropertyValue[] propertyValues){
- _NumberingLevel.PropertyArray = propertyValues;
+ this.PropertyArray = propertyValues;
- _NumberingLevel.log = log;
+ this.log = log;
//key = PropertyName, value = Ooptional
NumberingLevel.put("Adjust", Boolean.FALSE);
diff --git a/qadevOOo/tests/java/mod/_acceptor/Acceptor.java b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
index 67c479485abd..11b1a650df91 100644
--- a/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
+++ b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
@@ -45,7 +45,7 @@ public class Acceptor extends TestCase {
*/
protected static final int basePort = 10000;
private int curPort ;
- private static String sOfficeHost = null ;
+ private String sOfficeHost = null ;
/**
* Retrieves host name where StarOffice is started from test