What steps will reproduce the problem?
java -jar garbagecat-1.0.0.jar -p gc_err.log
What is the expected output? What do you see instead?
Exception in thread "main" java.lang.NullPointerException
at org.eclipselabs.garbagecat.service.GcaManager.preprocess(GcaManager.java:101)
fix:
problem is caused by string initialized to null
in the body of GcaManager.preprocess():
instead:
String currentLogLine = null ;
String priorLogLine = null ;
String preprocessedLogLine = null ;
should be:
String currentLogLine = "" ;
String priorLogLine = "" ;
String preprocessedLogLine = "" ;
---------
by the way I made some code cleanings in this method
proposed version in attachment
cleanings:
1.
close only external streams, when you build one stream on another it is enough
to close only external one
2. simplified while()
Original issue reported on code.google.com by jbor...@gmail.com on 5 May 2011 at 8:33
Original issue reported on code.google.com by
jbor...@gmail.com
on 5 May 2011 at 8:33Attachments: