- Timestamp:
- 2020-02-26T01:52:21+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
r15934 r15936 4 4 import java.lang.reflect.Method; 5 5 import java.text.MessageFormat; 6 import java.util.Arrays; 6 7 import java.util.EnumSet; 7 8 import java.util.Map; … … 828 829 829 830 protected static Method getMethod(String id) { 830 String cleanId = id.replaceAll("-|_", "");831 for (Method method : PseudoClasses.class.getDeclaredMethods()) {832 // for backwards compatibility, consider :sameTags == :same-tags == :same_tags (#11150)833 final String methodName = method.getName().replaceAll("-|_", "");834 if (methodName.equalsIgnoreCase(cleanId)) {835 return method; 836 }837 }838 return null;831 String cleanId = clean(id); 832 return Arrays.stream(PseudoClasses.class.getDeclaredMethods()) 833 .filter(method -> clean(method.getName()).equalsIgnoreCase(cleanId)) 834 .findFirst().orElse(null); 835 } 836 837 private static String clean(String id) { 838 // for backwards compatibility, consider :sameTags == :same-tags == :same_tags (#11150) 839 return id.replaceAll("[-_]", ""); 839 840 } 840 841
Note:
See TracChangeset
for help on using the changeset viewer.