diff --git a/src/cc/mallet/types/GainRatio.java b/src/cc/mallet/types/GainRatio.java index d4bacef1c..e19e872d3 100644 --- a/src/cc/mallet/types/GainRatio.java +++ b/src/cc/mallet/types/GainRatio.java @@ -242,7 +242,7 @@ protected static Object[] calcGainRatios(InstanceList ilist, int[] instIndices, } - assert(bestSplitPoint != Double.NaN); + assert(!Double.isNaN(bestSplitPoint)); gainRatios[fi] = featureMaxGainRatio; splitPoints[fi] = bestSplitPoint; diff --git a/src/cc/mallet/util/PropertyList.java b/src/cc/mallet/util/PropertyList.java index b18f75c11..18ba4485f 100644 --- a/src/cc/mallet/util/PropertyList.java +++ b/src/cc/mallet/util/PropertyList.java @@ -80,10 +80,10 @@ else if (this instanceof ObjectProperty) { if (obj == null) return 0; // xxx Remove these? Use might ask for numericIterator expecting to get these (and not!) if (obj instanceof Double) return ((Double)obj).doubleValue(); - if (obj instanceof Integer) return ((Double)obj).intValue(); - if (obj instanceof Float) return ((Double)obj).floatValue(); - if (obj instanceof Short) return ((Double)obj).shortValue(); - if (obj instanceof Long) return ((Double)obj).longValue(); + if (obj instanceof Integer) return ((Integer)obj).intValue(); + if (obj instanceof Float) return ((Float)obj).floatValue(); + if (obj instanceof Short) return ((Short)obj).shortValue(); + if (obj instanceof Long) return ((Long)obj).longValue(); // xxx? throw new IllegalStateException ("Property is not numeric."); return 0; } else