Package net.sf.colossus.guiutil
Class DebugMethods
java.lang.Object
net.sf.colossus.guiutil.DebugMethods
some small methods helpful during development,
to wait before program ends to see object instance
statistics, once just until return is pressed,
once a loop in which one can force GC, see object statistics,
etc. until one enters "x" to make the loop exit.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
doCleanupStuff
(boolean doSwingCleanup) It seems this is the sequence of things needed to achieve full garbage collection/cleanup of JFrame stuff (Java 1.4.2): GC and finalization, 2 dummy frames, do the SwingCleanup hack, and once again GC and finalization.static void
prints out "PRESS RETURN TO CONTINUE", and after return is pressed, prints then "OK, continuing" and returns.static void
waitReturnLoop
(boolean force) Repeatedly checks whether now all tracked objects are gone.
-
Constructor Details
-
DebugMethods
public DebugMethods()
-
-
Method Details
-
doCleanupStuff
public static void doCleanupStuff(boolean doSwingCleanup) It seems this is the sequence of things needed to achieve full garbage collection/cleanup of JFrame stuff (Java 1.4.2): GC and finalization, 2 dummy frames, do the SwingCleanup hack, and once again GC and finalization.- Parameters:
doSwingCleanup
- Whether to call the swingCleanup() method
-
waitReturn
public static void waitReturn()prints out "PRESS RETURN TO CONTINUE", and after return is pressed, prints then "OK, continuing" and returns. -
waitReturnLoop
public static void waitReturnLoop(boolean force) Repeatedly checks whether now all tracked objects are gone. Each round, does GC + finalize, and asks for input. For input "s", prints statistics. For input "x", exits the loop. Exits the loop also if all are gone. If from beginning on all are gone, does not even go into the loop.- Parameters:
force
- Go into loop even if allGone already returns true at begin
-