Changeset 8506 in josm
- Timestamp:
- 2015-06-19T23:34:50+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r8497 r8506 1759 1759 1760 1760 /** 1761 * Sets the given online resource to online state. 1762 * @param r the online resource 1763 * @return {@code true} if {@code r} was offline 1764 * @since 8506 1765 */ 1766 public static boolean setOnline(OnlineResource r) { 1767 return OFFLINE_RESOURCES.remove(r); 1768 } 1769 1770 /** 1761 1771 * Replies the set of online resources currently offline. 1762 1772 * @return the set of online resources currently offline -
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r8393 r8506 436 436 } 437 437 } 438 // if we get here, all the Tracks are finished; Continue with 439 // Routes 438 // if we get here, all the Tracks are finished; Continue with Routes 440 439 itTracks = null; 441 440 } -
trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java
r8468 r8506 38 38 /** 39 39 * Constructs a new {@code Bookmark} with the given contents. 40 * @param list Bookmark contents as a list of 5 elements. First item is the name, then come bounds arguments (minlat, minlon, maxlat, maxlon) 40 * @param list Bookmark contents as a list of 5 elements. 41 * First item is the name, then come bounds arguments (minlat, minlon, maxlat, maxlon) 41 42 * @throws NumberFormatException if the bounds arguments are not numbers 42 43 * @throws IllegalArgumentException if list contain less than 5 elements 43 44 */ 44 public Bookmark(Collection<String> list) throws NumberFormatException, IllegalArgumentException{45 public Bookmark(Collection<String> list) { 45 46 List<String> array = new ArrayList<>(list); 46 47 if(array.size() < 5) -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r8449 r8506 21 21 import java.io.File; 22 22 import java.io.FileInputStream; 23 import java.io.FileNotFoundException;24 23 import java.io.IOException; 25 24 import java.io.InputStream; … … 213 212 } 214 213 215 private InputStream createInputStream(File sel) throws IOException , FileNotFoundException{214 private InputStream createInputStream(File sel) throws IOException { 216 215 if (Utils.hasExtension(sel, "gpx.gz")) { 217 216 return new GZIPInputStream(new FileInputStream(sel)); -
trunk/src/org/openstreetmap/josm/plugins/Plugin.java
r7033 r8506 103 103 /** 104 104 * Copies the resource 'from' to the file in the plugin directory named 'to'. 105 * @throws FileNotFoundException if the file exists but is a directory rather than a regular file, 106 * does not exist but cannot be created, or cannot be opened for any other reason 107 * @throws IOException if any other I/O error occurs 105 108 */ 106 public void copy(String from, String to) throws FileNotFoundException,IOException {109 public void copy(String from, String to) throws IOException { 107 110 String pluginDirName = getPluginDir(); 108 111 File pluginDir = new File(pluginDirName); -
trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java
r8443 r8506 26 26 * @throws IllegalArgumentException if the primitive ID is not valid (negative or zero) 27 27 */ 28 public static void ensureValidPrimitiveId(PrimitiveId id, String parameterName) throws IllegalArgumentException{28 public static void ensureValidPrimitiveId(PrimitiveId id, String parameterName) { 29 29 ensureParameterNotNull(id, parameterName); 30 30 if (id.getUniqueId() <= 0) 31 throw new IllegalArgumentException(MessageFormat.format("Expected unique id > 0 for primitive ''{1}'', got {0}", id.getUniqueId(), parameterName)); 31 throw new IllegalArgumentException( 32 MessageFormat.format("Expected unique id > 0 for primitive ''{1}'', got {0}", id.getUniqueId(), parameterName)); 32 33 } 33 34 … … 39 40 * @since 5980 40 41 */ 41 public static void ensureValidCoordinates(LatLon latlon, String parameterName) throws IllegalArgumentException{42 public static void ensureValidCoordinates(LatLon latlon, String parameterName) { 42 43 ensureParameterNotNull(latlon, parameterName); 43 44 if (!latlon.isValid()) 44 throw new IllegalArgumentException(MessageFormat.format("Expected valid lat/lon for parameter ''{0}'', got {1}", parameterName, latlon)); 45 throw new IllegalArgumentException( 46 MessageFormat.format("Expected valid lat/lon for parameter ''{0}'', got {1}", parameterName, latlon)); 45 47 } 46 48 … … 52 54 * @since 5980 53 55 */ 54 public static void ensureValidCoordinates(EastNorth eastnorth, String parameterName) throws IllegalArgumentException{56 public static void ensureValidCoordinates(EastNorth eastnorth, String parameterName) { 55 57 ensureParameterNotNull(eastnorth, parameterName); 56 58 if (!eastnorth.isValid()) 57 throw new IllegalArgumentException(MessageFormat.format("Expected valid east/north for parameter ''{0}'', got {1}", parameterName, eastnorth)); 59 throw new IllegalArgumentException( 60 MessageFormat.format("Expected valid east/north for parameter ''{0}'', got {1}", parameterName, eastnorth)); 58 61 } 59 62 … … 64 67 * @throws IllegalArgumentException if the version is not valid (negative) 65 68 */ 66 public static void ensureValidVersion(long version, String parameterName) throws IllegalArgumentException{69 public static void ensureValidVersion(long version, String parameterName) { 67 70 if (version < 0) 68 throw new IllegalArgumentException(MessageFormat.format("Expected value of type long > 0 for parameter ''{0}'', got {1}", parameterName, version)); 71 throw new IllegalArgumentException( 72 MessageFormat.format("Expected value of type long > 0 for parameter ''{0}'', got {1}", parameterName, version)); 69 73 } 70 74 … … 75 79 * @throws IllegalArgumentException if the parameter is {@code null} 76 80 */ 77 public static void ensureParameterNotNull(Object value, String parameterName) throws IllegalArgumentException{81 public static void ensureParameterNotNull(Object value, String parameterName) { 78 82 if (value == null) 79 83 throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' must not be null", parameterName)); … … 86 90 * @since 3871 87 91 */ 88 public static void ensureParameterNotNull(Object value) throws IllegalArgumentException{92 public static void ensureParameterNotNull(Object value) { 89 93 if (value == null) 90 94 throw new IllegalArgumentException("Parameter must not be null"); … … 96 100 * @throws IllegalArgumentException if the condition does not hold 97 101 */ 98 public static void ensureThat(boolean condition, String message) throws IllegalArgumentException{102 public static void ensureThat(boolean condition, String message) { 99 103 if (!condition) 100 104 throw new IllegalArgumentException(message); … … 104 108 * Ensures that <code>id</code> is non-null primitive id of type {@link OsmPrimitiveType#NODE} 105 109 * 106 * @param id 110 * @param id the primitive id 107 111 * @param parameterName the name of the parameter to be checked 108 112 * @throws IllegalArgumentException if id is null 109 113 * @throws IllegalArgumentException if id.getType() != NODE 110 114 */ 111 public static void ensureValidNodeId(PrimitiveId id, String parameterName) throws IllegalArgumentException{115 public static void ensureValidNodeId(PrimitiveId id, String parameterName) { 112 116 ensureParameterNotNull(id, parameterName); 113 117 if (!id.getType().equals(OsmPrimitiveType.NODE)) 114 throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' of type node expected, got ''{1}''", parameterName, id.getType().getAPIName())); 118 throw new IllegalArgumentException( 119 MessageFormat.format("Parameter ''{0}'' of type node expected, got ''{1}''", parameterName, id.getType().getAPIName())); 115 120 } 116 121 }
Note:
See TracChangeset
for help on using the changeset viewer.