summaryrefslogtreecommitdiff
path: root/sources/core
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-06-12 21:16:10 +0000
committerPaul Buetow <paul@buetow.org>2008-06-12 21:16:10 +0000
commit64a08ca2f7f574e63c39b10f8daaf69ee0dba391 (patch)
tree09b6d41834e8809036e8b79a17a0271ebb6893a8 /sources/core
parent4f9a13071e3aba7291711a62358ab83374321433 (diff)
fixed some bugs.
Diffstat (limited to 'sources/core')
-rw-r--r--sources/core/VSTask.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java
index d5e4274..13f9c01 100644
--- a/sources/core/VSTask.java
+++ b/sources/core/VSTask.java
@@ -317,9 +317,6 @@ public class VSTask implements Comparable, VSSerializable {
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public int compareTo(Object object) {
- if (object == null)
- return 0;
-
if (object instanceof VSTask) {
final VSTask task = (VSTask) object;
@@ -331,9 +328,6 @@ public class VSTask implements Comparable, VSSerializable {
VSAbstractEvent event2 = task.getEvent();
- if (event2 == null || event == null)
- return 0;
-
/* If it's a recovering, it should get handled very first */
boolean a = event instanceof VSProcessRecoverEvent;
boolean b = event2 instanceof VSProcessRecoverEvent;
@@ -373,7 +367,15 @@ public class VSTask implements Comparable, VSSerializable {
if (b)
return 1;
- return event.getShortname().compareTo(event2.getShortname());
+ String shortname = event.getShortname();
+ String shortname2 = event2.getShortname();
+
+ /* One of those may be null if an VSAbstractEvent object has not
+ been initialized yet */
+ if (shortname == null || shortname2 == null)
+ return 0;
+
+ return shortname.compareTo(shortname2);
}
return 0;