diff --git a/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java b/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java index acbea32..1087787 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java +++ b/core/src/main/java/edu/umd/cs/piccolo/util/PUtil.java @@ -54,8 +54,12 @@ */ public class PUtil { - public static Iterator NULL_ITERATOR = Collections.EMPTY_LIST.iterator(); - public static Enumeration NULL_ENUMERATION = new Enumeration() { + public static long DEFAULT_ACTIVITY_STEP_RATE = 20; + public static int ACTIVITY_SCHEDULER_FRAME_DELAY = 10; + private static final int PATH_IS_DONE = -1; + + public static final Iterator NULL_ITERATOR = Collections.EMPTY_LIST.iterator(); + public static final Enumeration NULL_ENUMERATION = new Enumeration() { public boolean hasMoreElements() { return false; } @@ -64,10 +68,8 @@ return null; } }; - public static long DEFAULT_ACTIVITY_STEP_RATE = 20; - public static int ACTIVITY_SCHEDULER_FRAME_DELAY = 10; - public static OutputStream NULL_OUTPUT_STREAM = new OutputStream() { + public static final OutputStream NULL_OUTPUT_STREAM = new OutputStream() { public void close() { } @@ -137,13 +139,13 @@ if (!wroteStroke) { return null; } - + boolean serializedStroke = in.readBoolean(); if (serializedStroke) { return (Stroke) in.readObject(); } - - return readBasicStroke(in); + + return readBasicStroke(in); } private static Stroke readBasicStroke(ObjectInputStream in) throws IOException { @@ -166,8 +168,6 @@ return new BasicStroke(lineWidth, endCap, lineJoin, miterLimit, dash, dashPhase); } - private static final int PATH_IS_DONE = -1; - public static GeneralPath readPath(ObjectInputStream in) throws IOException, ClassNotFoundException { GeneralPath path = new GeneralPath();