Changeset 7246 in josm
- Timestamp:
- 2014-06-13T07:35:31+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r7238 r7246 146 146 return !(s.isEmpty() || "false".equals(s) || "no".equals(s) || "0".equals(s) || "0.0".equals(s)); 147 147 if (o instanceof Number) 148 return ((Number) o).floatValue() == 0.0f;148 return ((Number) o).floatValue() != 0.0f; 149 149 if (o instanceof List) 150 150 return !((List) o).isEmpty(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r7238 r7246 431 431 */ 432 432 public static boolean equal(Object a, Object b) { 433 // make sure the casts are done in a meaningful way, so 434 // the 2 objects really can be considered equal 435 for (Class<?> klass : new Class<?>[]{Float.class, Boolean.class, Color.class, float[].class, String.class}) { 436 Object a2 = Cascade.convertTo(a, klass); 437 Object b2 = Cascade.convertTo(b, klass); 438 if (a2 != null && b2 != null && a2.equals(b2)) { 439 return true; 440 } 441 } 442 return false; 433 if (a.getClass() == b.getClass()) return a.equals(b); 434 if (a.equals(Cascade.convertTo(b, a.getClass()))) return true; 435 return b.equals(Cascade.convertTo(a, b.getClass())); 443 436 } 444 437
Note:
See TracChangeset
for help on using the changeset viewer.