Fix intermittent ClassCastExceptions on job console

* Histotable.java, ToePool.java
    only tally Strings; convert all histotable keys to strings for sorting
This commit is contained in:
gojomo
2009-10-07 10:18:21 +00:00
parent f960a018c1
commit 45f09818ae
2 changed files with 3 additions and 3 deletions
@@ -83,8 +83,8 @@ public class Histotable<K> extends TreeMap<K,Long> {
if (firstVal < secondVal) { return 1; }
if (secondVal < firstVal) { return -1; }
// If the values are the same, sort by keys.
String firstKey = (String) ((Map.Entry<K,Long>) e1).getKey();
String secondKey = (String) ((Map.Entry<K,Long>) e2).getKey();
String firstKey = ((Map.Entry<K,Long>) e1).getKey().toString();
String secondKey = ((Map.Entry<K,Long>) e2).getKey().toString();
return firstKey.compareTo(secondKey);
}
});
@@ -270,7 +270,7 @@ public class ToePool extends ThreadGroup implements MultiReporter {
}
ToeThread tt = (ToeThread)toes[i];
if(tt!=null) {
steps.tally(tt.getStep());
steps.tally(tt.getStep().toString());
processors.tally(tt.getCurrentProcessorName());
}
}