summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/stats
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/runner/stats
parent0ae24c2189ea68576c96fcbe87299b51256cb468 (diff)
java: static fields that should not be static
Found by FindBugs. Change-Id: I223841f7bb8c515c9612322abc0b13e134385abd
Diffstat (limited to 'qadevOOo/runner/stats')
-rw-r--r--qadevOOo/runner/stats/InternalLogWriter.java34
1 files changed, 11 insertions, 23 deletions
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;
}