Changeset 10780 in josm
- Timestamp:
- 2016-08-11T15:26:17+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r10774 r10780 97 97 public static void addMatchFactory(MatchFactory factory) { 98 98 for (String keyword : factory.getKeywords()) { 99 // TODO: check for keyword collisions99 final MatchFactory existing; 100 100 if (factory instanceof SimpleMatchFactory) { 101 simpleMatchFactoryMap.put(keyword, (SimpleMatchFactory) factory);101 existing = simpleMatchFactoryMap.put(keyword, (SimpleMatchFactory) factory); 102 102 } else if (factory instanceof UnaryMatchFactory) { 103 unaryMatchFactoryMap.put(keyword, (UnaryMatchFactory) factory);103 existing = unaryMatchFactoryMap.put(keyword, (UnaryMatchFactory) factory); 104 104 } else if (factory instanceof BinaryMatchFactory) { 105 binaryMatchFactoryMap.put(keyword, (BinaryMatchFactory) factory);105 existing = binaryMatchFactoryMap.put(keyword, (BinaryMatchFactory) factory); 106 106 } else 107 107 throw new AssertionError("Unknown match factory"); 108 if (existing != null) { 109 Main.warn("SearchCompiler: for key ''{0}'', overriding match factory ''{1}'' with ''{2}''", keyword, existing, factory); 110 } 108 111 } 109 112 }
Note:
See TracChangeset
for help on using the changeset viewer.