- Timestamp:
- 2014-05-07T23:21:47+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r7013 r7073 55 55 * Dataset is threadsafe - accessing Dataset simultaneously from different threads should never 56 56 * lead to data corruption or ConccurentModificationException. However when for example one thread 57 * removes primitive and other thread try to add another primitive ref fering to the removed primitive,57 * removes primitive and other thread try to add another primitive referring to the removed primitive, 58 58 * DataIntegrityException will occur. 59 59 * -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r7069 r7073 48 48 import org.openstreetmap.josm.io.UTFInputStreamReader; 49 49 import org.openstreetmap.josm.tools.CheckParameterUtil; 50 import org.openstreetmap.josm.tools.MultiMap;51 50 import org.openstreetmap.josm.tools.Predicate; 52 51 import org.openstreetmap.josm.tools.Utils; … … 192 191 removeMetaRules(source); 193 192 // group rules with common declaration block 194 M ultiMap<MapCSSRule.Declaration, MapCSSRule> rules = new MultiMap<>();193 Map<Declaration, List<Selector>> g = new LinkedHashMap<>(); 195 194 for (MapCSSRule rule : source.rules) { 196 rules.put(rule.declaration, rule); 195 if (!g.containsKey(rule.declaration)) { 196 List<Selector> sels = new ArrayList<>(); 197 sels.add(rule.selector); 198 g.put(rule.declaration, sels); 199 } else { 200 g.get(rule.declaration).add(rule.selector); 201 } 197 202 } 198 203 List<TagCheck> result = new ArrayList<>(); 199 for (Collection<MapCSSRule> rulesCommonDecl : rules.values()) { 200 List<Selector> selectors = new ArrayList<>(); 201 for (MapCSSRule rule : rulesCommonDecl) { 202 selectors.add(rule.selector); 203 } 204 if (!rulesCommonDecl.isEmpty()) { 205 result.add(TagCheck.ofMapCSSRule( 206 new GroupedMapCSSRule(selectors, rulesCommonDecl.iterator().next().declaration))); 207 } 204 for (Map.Entry<Declaration, List<Selector>> map : g.entrySet()) { 205 result.add(TagCheck.ofMapCSSRule( 206 new GroupedMapCSSRule(map.getValue(), map.getKey()))); 208 207 } 209 208 return result;
Note:
See TracChangeset
for help on using the changeset viewer.