I observed that the constructor FixedMillisecond(long) creates a Date object to retrieve the original long value. From my point of view this is not necessary. Although the objects are temporary only it should be faster not to create them.
Please find a patch below.
Ulrich
Code: Select all
### Eclipse Workspace Patch 1.0
#P JFree_ORG
Index: source/org/jfree/data/time/FixedMillisecond.java
===================================================================
--- source/org/jfree/data/time/FixedMillisecond.java (revision 3296)
+++ source/org/jfree/data/time/FixedMillisecond.java (working copy)
@@ -65,7 +65,7 @@
private static final long serialVersionUID = 7867521484545646931L;
/** The millisecond. */
- private long time;
+ private final long time;
/**
* Constructs a millisecond based on the current system time.
@@ -80,7 +80,7 @@
* @param millisecond the millisecond (same encoding as java.util.Date).
*/
public FixedMillisecond(long millisecond) {
- this(new Date(millisecond));
+ this.time = millisecond;
}
/**
@@ -89,7 +89,7 @@
* @param time the time.
*/
public FixedMillisecond(Date time) {
- this.time = time.getTime();
+ this(time.getTime());
}
/**