- Timestamp:
- 2015-10-24T00:54:52+02:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r8512 r8937 11 11 import java.util.Arrays; 12 12 import java.util.Collection; 13 import java.util.Collections; 13 14 import java.util.HashSet; 14 15 import java.util.LinkedList; … … 266 267 } 267 268 } 268 if (Main.isDebugEnabled()) { 269 if (Main.isDebugEnabled() || !source.getErrors().isEmpty()) { 269 270 final long elapsedTime = System.currentTimeMillis() - startTime; 270 Main.debug("Initializing map style " + source.url + " completed in " + Utils.getDurationString(elapsedTime)); 271 String message = "Initializing map style " + source.url + " completed in " + Utils.getDurationString(elapsedTime); 272 if (!source.getErrors().isEmpty()) { 273 Main.warn(message + " (" + source.getErrors().size() + " errors)"); 274 } else { 275 Main.debug(message); 276 } 271 277 } 272 278 } … … 433 439 } 434 440 435 public static void addStyle(SourceEntry entry) { 441 /** 442 * Add a new map paint style. 443 * @param entry map paint style 444 * @return list of errors that occured during loading 445 */ 446 public static Collection<Throwable> addStyle(SourceEntry entry) { 436 447 StyleSource source = fromSourceEntry(entry); 437 448 if (source != null) { … … 441 452 fireMapPaintSylesUpdated(); 442 453 styles.clearCached(); 443 Main.map.mapView.repaint(); 444 } 454 if (Main.isDisplayingMapView()) { 455 Main.map.mapView.repaint(); 456 } 457 return source.getErrors(); 458 } 459 return Collections.emptyList(); 445 460 } 446 461 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r8926 r8937 83 83 public static final String OPTIONAL_TOOLTIP_TEXT = "Optional tooltip text"; 84 84 85 /** Prefix of preset icon loading failure error message */ 86 public static final String PRESET_ICON_ERROR_MSG_PREFIX = "Could not get presets icon "; 87 85 88 public TaggingPresetMenu group; 86 89 public String name; … … 166 169 * Called from the XML parser to set the icon. 167 170 * The loading task is performed in the background in order to speedup startup. 171 * @param iconName icon name 168 172 */ 169 173 public void setIcon(final String iconName) { … … 190 194 }); 191 195 } else { 192 Main.warn( "Could not get presets icon "+ iconName);196 Main.warn(PRESET_ICON_ERROR_MSG_PREFIX + iconName); 193 197 } 194 198 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTest.java
r8936 r8937 6 6 7 7 import java.io.IOException; 8 import java.util.ArrayList; 8 9 import java.util.Collection; 9 10 … … 35 36 */ 36 37 @Test 37 public void testValidityOfAvailable Sources() throws ParseException, IOException {38 public void testValidityOfAvailableRules() throws ParseException, IOException { 38 39 Collection<ExtendedSourceEntry> sources = new ValidatorTagCheckerRulesPreference.TagCheckerRulesSourceEditor() 39 40 .loadAndGetAvailableSources(); 40 41 assertFalse(sources.isEmpty()); 42 Collection<Throwable> allErrors = new ArrayList<>(); 41 43 MapCSSTagChecker tagChecker = new MapCSSTagChecker(); 42 44 for (ExtendedSourceEntry source : sources) { … … 44 46 ParseResult result = tagChecker.addMapCSS(source.url); 45 47 assertFalse(result.parseChecks.isEmpty()); 46 assertTrue(result.parseErrors.isEmpty());47 System.out.println(" => OK");48 System.out.println(result.parseErrors.isEmpty() ? " => OK" : " => KO"); 49 allErrors.addAll(result.parseErrors); 48 50 } 51 assertTrue(allErrors.isEmpty()); 49 52 } 50 53 }
Note:
See TracChangeset
for help on using the changeset viewer.