Commit d425e953 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

these fields are actually private

parent a475374c
...@@ -16,10 +16,10 @@ import java.io.PrintStream; ...@@ -16,10 +16,10 @@ import java.io.PrintStream;
* @author Gabor Jenei * @author Gabor Jenei
*/ */
public class ConsoleErrorHandler implements ErrorHandler { public class ConsoleErrorHandler implements ErrorHandler {
protected PrintStream errorStream; private PrintStream errorStream;
protected PrintStream warningStream; private PrintStream warningStream;
protected PrintStream informationStream; private PrintStream informationStream;
protected StringBuilder collectedMessage; private StringBuilder collectedMessage;
/** /**
* This constructor sets {@link System#err} for error messages and * This constructor sets {@link System#err} for error messages and
...@@ -83,7 +83,8 @@ public class ConsoleErrorHandler implements ErrorHandler { ...@@ -83,7 +83,8 @@ public class ConsoleErrorHandler implements ErrorHandler {
@Override @Override
public void writeMessageToLog() { public void writeMessageToLog() {
errorStream.println(collectedMessage.toString()); errorStream.println(collectedMessage.toString());
collectedMessage = new StringBuilder(); collectedMessage.setLength(0);
collectedMessage.trimToSize();
} }
} }
...@@ -19,7 +19,7 @@ import org.eclipse.titan.common.logging.ErrorReporter; ...@@ -19,7 +19,7 @@ import org.eclipse.titan.common.logging.ErrorReporter;
* @author Gabor Jenei * @author Gabor Jenei
*/ */
public class GUIErrorHandler implements ErrorHandler { public class GUIErrorHandler implements ErrorHandler {
protected StringBuilder collectedMessage; private StringBuilder collectedMessage;
/** /**
* Constructor * Constructor
...@@ -90,7 +90,8 @@ public class GUIErrorHandler implements ErrorHandler { ...@@ -90,7 +90,8 @@ public class GUIErrorHandler implements ErrorHandler {
public void writeMessageToLog() { public void writeMessageToLog() {
if (collectedMessage.length() != 0) { if (collectedMessage.length() != 0) {
ErrorReporter.logError(collectedMessage.toString()); ErrorReporter.logError(collectedMessage.toString());
collectedMessage = new StringBuilder(); collectedMessage.setLength(0);
collectedMessage.trimToSize();
ErrorMessage.show("Error log", "Various errors happened! For details see the error log.",MessageDialog.ERROR); ErrorMessage.show("Error log", "Various errors happened! For details see the error log.",MessageDialog.ERROR);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment