* Make Property.compareTo() immune against float/integer confusion, which is quite common in rhino.
This commit is contained in:
parent
aaa15f5670
commit
bfdd643a99
1 changed files with 3 additions and 0 deletions
|
@ -513,6 +513,9 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (type != ptype) {
|
if (type != ptype) {
|
||||||
|
// float/integer sometimes get mixed up in Rhino
|
||||||
|
if ((type == FLOAT && ptype == INTEGER) || (type == INTEGER && ptype == FLOAT))
|
||||||
|
return Double.compare(((Number) value).doubleValue(), ((Number) pvalue).doubleValue());
|
||||||
throw new ClassCastException("uncomparable values " + this + "(" + type + ") : " + p + "(" + ptype + ")");
|
throw new ClassCastException("uncomparable values " + this + "(" + type + ") : " + p + "(" + ptype + ")");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue