Changeset 6506 in josm
- Timestamp:
- 2013-12-22T00:09:16+01:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Tag.java
r5058 r6506 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.osm; 3 4 import org.openstreetmap.josm.tools.CheckParameterUtil; 3 5 4 6 /** … … 97 99 } 98 100 101 public static Tag ofString(String s) { 102 CheckParameterUtil.ensureParameterNotNull(s, "s"); 103 final String[] x = s.split("=", 2); 104 if (x.length == 2) { 105 return new Tag(x[0], x[1]); 106 } else { 107 throw new IllegalArgumentException("String does not contain '='"); 108 } 109 } 110 99 111 @Override 100 112 public String toString() { -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r6472 r6506 35 35 import org.openstreetmap.josm.data.validation.tests.DuplicatedWayNodes; 36 36 import org.openstreetmap.josm.data.validation.tests.Highways; 37 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker; 37 38 import org.openstreetmap.josm.data.validation.tests.MultipolygonTest; 38 39 import org.openstreetmap.josm.data.validation.tests.NameMismatch; … … 106 107 DuplicateRelation.class, // ID 1901 .. 1999 107 108 BuildingInBuilding.class, // ID 2001 .. 2099 108 DeprecatedTags.class, // ID 2101 .. 2199109 //DeprecatedTags.class, // ID 2101 .. 2199 109 110 OverlappingAreas.class, // ID 2201 .. 2299 110 111 WayConnectedToArea.class, // ID 2301 .. 2399 … … 114 115 Highways.class, // ID 2701 .. 2799 115 116 BarriersEntrances.class, // ID 2801 .. 2899 116 OpeningHourTest.class // 2901 .. 2999 117 OpeningHourTest.class, // 2901 .. 2999 118 MapCSSTagChecker.class, // 3000 .. 3099 117 119 }; 118 120 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r6362 r6506 359 359 return env.osm.getUniqueId(); 360 360 } 361 362 public static String tr(String... args) { 363 final String text = args[0]; 364 System.arraycopy(args, 1, args, 0, args.length - 1); 365 return org.openstreetmap.josm.tools.I18n.tr(text, args); 366 } 361 367 } 362 368 -
trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java
r6362 r6506 92 92 93 93 /** 94 * Ensures that the condition {@code condition} holds. 95 * @param condition The condition to check 96 * @throws IllegalArgumentException if the condition does not hold 97 */ 98 public static void ensureThat(boolean condition, String message) throws IllegalArgumentException { 99 if (!condition) 100 throw new IllegalArgumentException(message); 101 } 102 103 /** 94 104 * Ensures that <code>id</code> is non-null primitive id of type {@link OsmPrimitiveType#NODE} 95 105 *
Note:
See TracChangeset
for help on using the changeset viewer.