Changeset 6142 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2013-08-11T21:23:19+02:00 (11 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
r6070 r6142 147 147 return (float[]) o; 148 148 if (o instanceof List) { 149 List l = (List) o;149 List<?> l = (List<?>) o; 150 150 float[] a = new float[l.size()]; 151 151 for (int i=0; i<l.size(); ++i) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r5714 r6142 131 131 } 132 132 133 public static Object get(List objects, float index) {133 public static Object get(List<? extends Object> objects, float index) { 134 134 int idx = Math.round(index); 135 135 if (idx >= 0 && idx < objects.size()) { … … 139 139 } 140 140 141 public static List split(String sep, String toSplit) {141 public static List<String> split(String sep, String toSplit) { 142 142 return Arrays.asList(toSplit.split(Pattern.quote(sep), -1)); 143 143 } … … 265 265 } 266 266 267 @SuppressWarnings(value = "unchecked")268 267 public static boolean equal(Object a, Object b) { 269 268 // make sure the casts are done in a meaningful way, so 270 269 // the 2 objects really can be considered equal 271 for (Class klass : new Class[]{Float.class, Boolean.class, Color.class, float[].class, String.class}) {270 for (Class<?> klass : new Class[]{Float.class, Boolean.class, Color.class, float[].class, String.class}) { 272 271 Object a2 = Cascade.convertTo(a, klass); 273 272 Object b2 = Cascade.convertTo(b, klass); … … 317 316 } 318 317 319 public static List regexp_match(String pattern, String target, String flags) {318 public static List<String> regexp_match(String pattern, String target, String flags) { 320 319 int f = 0; 321 320 if (flags.contains("i")) { … … 340 339 } 341 340 342 public static List regexp_match(String pattern, String target) {341 public static List<String> regexp_match(String pattern, String target) { 343 342 Matcher m = Pattern.compile(pattern).matcher(target); 344 343 if (m.matches()) { … … 480 479 @Override 481 480 public Object evaluate(Environment env) { 482 List l = Cascade.convertTo(arg.evaluate(env), List.class);481 List<?> l = Cascade.convertTo(arg.evaluate(env), List.class); 483 482 if (l != null) 484 483 return l.size();
Note:
See TracChangeset
for help on using the changeset viewer.