Changeset 10755 in josm
- Timestamp:
- 2016-08-07T14:46:57+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r10619 r10755 21 21 import org.openstreetmap.josm.io.FileExporter; 22 22 import org.openstreetmap.josm.io.FileImporter; 23 import org.openstreetmap.josm.io.GpxImporter; 24 import org.openstreetmap.josm.io.JpgImporter; 25 import org.openstreetmap.josm.io.NMEAImporter; 26 import org.openstreetmap.josm.io.NoteImporter; 27 import org.openstreetmap.josm.io.OsmChangeImporter; 28 import org.openstreetmap.josm.io.OsmImporter; 29 import org.openstreetmap.josm.io.WMSLayerImporter; 30 import org.openstreetmap.josm.io.session.SessionImporter; 23 31 import org.openstreetmap.josm.tools.Utils; 24 32 … … 51 59 52 60 final List<Class<? extends FileImporter>> importerNames = Arrays.asList( 53 org.openstreetmap.josm.io.OsmImporter.class,54 org.openstreetmap.josm.io.OsmChangeImporter.class,55 org.openstreetmap.josm.io.GpxImporter.class,56 org.openstreetmap.josm.io.NMEAImporter.class,57 org.openstreetmap.josm.io.NoteImporter.class,58 org.openstreetmap.josm.io.JpgImporter.class,59 org.openstreetmap.josm.io.WMSLayerImporter.class,60 org.openstreetmap.josm.io.AllFormatsImporter.class,61 org.openstreetmap.josm.io.session.SessionImporter.class61 OsmImporter.class, 62 OsmChangeImporter.class, 63 GpxImporter.class, 64 NMEAImporter.class, 65 NoteImporter.class, 66 JpgImporter.class, 67 WMSLayerImporter.class, 68 AllFormatsImporter.class, 69 SessionImporter.class 62 70 ); 63 71 -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r10463 r10755 1008 1008 * @return outer ways 1009 1009 */ 1010 private List<AssembledMultipolygon> findPolygons(Collection<AssembledPolygon> boundaries) {1010 private static List<AssembledMultipolygon> findPolygons(Collection<AssembledPolygon> boundaries) { 1011 1011 1012 1012 List<PolygonLevel> list = findOuterWaysImpl(0, boundaries); -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r10728 r10755 46 46 */ 47 47 public abstract class JCSCachedTileLoaderJob<K, V extends CacheEntry> implements ICachedLoaderJob<K> { 48 private static final Logger log= FeatureAdapter.getLogger(JCSCachedTileLoaderJob.class.getCanonicalName());48 private static final Logger LOG = FeatureAdapter.getLogger(JCSCachedTileLoaderJob.class.getCanonicalName()); 49 49 protected static final long DEFAULT_EXPIRE_TIME = 1000L * 60 * 60 * 24 * 7; // 7 days 50 50 // Limit for the max-age value send by the server. … … 159 159 } 160 160 if (deduplicationKey == null) { 161 log.log(Level.WARNING, "No url returned for: {0}, skipping", getCacheKey());161 LOG.log(Level.WARNING, "No url returned for: {0}, skipping", getCacheKey()); 162 162 throw new IllegalArgumentException("No url returned"); 163 163 } … … 174 174 if (first || force) { 175 175 // submit all jobs to separate thread, so calling thread is not blocked with IO when loading from disk 176 log.log(Level.FINE, "JCS - Submitting job for execution for url: {0}", getUrlNoException());176 LOG.log(Level.FINE, "JCS - Submitting job for execution for url: {0}", getUrlNoException()); 177 177 downloadJobExecutor.execute(this); 178 178 } … … 222 222 final String oldName = currentThread.getName(); 223 223 currentThread.setName("JCS Downloading: " + getUrlNoException()); 224 log.log(Level.FINE, "JCS - starting fetch of url: {0} ", getUrlNoException());224 LOG.log(Level.FINE, "JCS - starting fetch of url: {0} ", getUrlNoException()); 225 225 ensureCacheElement(); 226 226 try { … … 228 228 if (!force && cacheElement != null && isCacheElementValid() && isObjectLoadable()) { 229 229 // we got something in cache, and it's valid, so lets return it 230 log.log(Level.FINE, "JCS - Returning object from cache: {0}", getCacheKey());230 LOG.log(Level.FINE, "JCS - Returning object from cache: {0}", getCacheKey()); 231 231 finishLoading(LoadResult.SUCCESS); 232 232 return; … … 241 241 // try to get stale entry in cache 242 242 finishLoading(LoadResult.SUCCESS); 243 log.log(Level.FINE, "JCS - found stale object in cache: {0}", getUrlNoException());243 LOG.log(Level.FINE, "JCS - found stale object in cache: {0}", getUrlNoException()); 244 244 } else { 245 245 // failed completely … … 259 259 } 260 260 if (listeners == null) { 261 log.log(Level.WARNING, "Listener not found for URL: {0}. Listener not notified!", getUrlNoException());261 LOG.log(Level.WARNING, "Listener not found for URL: {0}. Listener not notified!", getUrlNoException()); 262 262 return; 263 263 } … … 276 276 expires = Math.min(expires, attributes.getCreateTime() + EXPIRE_TIME_SERVER_LIMIT); 277 277 if (now > expires) { 278 log.log(Level.FINE, "JCS - Object {0} has expired -> valid to {1}, now is: {2}",278 LOG.log(Level.FINE, "JCS - Object {0} has expired -> valid to {1}, now is: {2}", 279 279 new Object[]{getUrlNoException(), Long.toString(expires), Long.toString(now)}); 280 280 return false; … … 283 283 now - attributes.getLastModification() > DEFAULT_EXPIRE_TIME) { 284 284 // check by file modification date 285 log.log(Level.FINE, "JCS - Object has expired, maximum file age reached {0}", getUrlNoException());285 LOG.log(Level.FINE, "JCS - Object has expired, maximum file age reached {0}", getUrlNoException()); 286 286 return false; 287 287 } else if (now - attributes.getCreateTime() > DEFAULT_EXPIRE_TIME) { 288 log.log(Level.FINE, "JCS - Object has expired, maximum time since object creation reached {0}", getUrlNoException());288 LOG.log(Level.FINE, "JCS - Object has expired, maximum time since object creation reached {0}", getUrlNoException()); 289 289 return false; 290 290 } … … 305 305 Boolean.TRUE.equals(useHead.get(getServerKey())) && 306 306 isCacheValidUsingHead()) { 307 log.log(Level.FINE, "JCS - cache entry verified using HEAD request: {0}", getUrl());307 LOG.log(Level.FINE, "JCS - cache entry verified using HEAD request: {0}", getUrl()); 308 308 return true; 309 309 } … … 324 324 // If isModifiedSince or If-None-Match has been set 325 325 // and the server answers with a HTTP 304 = "Not Modified" 326 log.log(Level.FINE, "JCS - If-Modified-Since/ETag test: local version is up to date: {0}", getUrl());326 LOG.log(Level.FINE, "JCS - If-Modified-Since/ETag test: local version is up to date: {0}", getUrl()); 327 327 return true; 328 328 } else if (isObjectLoadable() // we have an object in cache, but we haven't received 304 response code … … 334 334 // for further requests - use HEAD 335 335 String serverKey = getServerKey(); 336 log.log(Level.INFO, "JCS - Host: {0} found not to return 304 codes for If-Modified-Since or If-None-Match headers",336 LOG.log(Level.INFO, "JCS - Host: {0} found not to return 304 codes for If-Modified-Since or If-None-Match headers", 337 337 serverKey); 338 338 useHead.put(serverKey, Boolean.TRUE); … … 360 360 cacheData = createCacheEntry(raw); 361 361 cache.put(getCacheKey(), cacheData, attributes); 362 log.log(Level.FINE, "JCS - downloaded key: {0}, length: {1}, url: {2}",362 LOG.log(Level.FINE, "JCS - downloaded key: {0}, length: {1}, url: {2}", 363 363 new Object[] {getCacheKey(), raw.length, getUrl()}); 364 364 return true; … … 366 366 cacheData = createCacheEntry(new byte[]{}); 367 367 cache.put(getCacheKey(), cacheData, attributes); 368 log.log(Level.FINE, "JCS - Caching empty object {0}", getUrl());368 LOG.log(Level.FINE, "JCS - Caching empty object {0}", getUrl()); 369 369 return true; 370 370 } else { 371 log.log(Level.FINE, "JCS - failure during load - reponse is not loadable nor cached as empty");371 LOG.log(Level.FINE, "JCS - failure during load - reponse is not loadable nor cached as empty"); 372 372 return false; 373 373 } 374 374 } 375 375 } catch (FileNotFoundException e) { 376 log.log(Level.FINE, "JCS - Caching empty object as server returned 404 for: {0}", getUrlNoException());376 LOG.log(Level.FINE, "JCS - Caching empty object as server returned 404 for: {0}", getUrlNoException()); 377 377 attributes.setResponseCode(404); 378 378 attributes.setError(e); … … 384 384 return doCache; 385 385 } catch (IOException e) { 386 log.log(Level.FINE, "JCS - IOExecption during communication with server for: {0}", getUrlNoException());386 LOG.log(Level.FINE, "JCS - IOExecption during communication with server for: {0}", getUrlNoException()); 387 387 if (isObjectLoadable()) { 388 388 return true; … … 395 395 } catch (InterruptedException e) { 396 396 attributes.setError(e); 397 log.log(Level.WARNING, "JCS - Exception during download {0}", getUrlNoException());397 LOG.log(Level.WARNING, "JCS - Exception during download {0}", getUrlNoException()); 398 398 Main.warn(e); 399 399 } 400 log.log(Level.WARNING, "JCS - Silent failure during download: {0}", getUrlNoException());400 LOG.log(Level.WARNING, "JCS - Silent failure during download: {0}", getUrlNoException()); 401 401 return false; 402 402 } -
trunk/src/org/openstreetmap/josm/data/osm/TagMap.java
r10736 r10755 280 280 stringBuilder.append("TagMap["); 281 281 boolean first = true; 282 for ( java.util.Map.Entry<String, String> e : entrySet()) {282 for (Map.Entry<String, String> e : entrySet()) { 283 283 if (!first) { 284 284 stringBuilder.append(','); -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java
r10378 r10755 38 38 * @since 6390 39 39 */ 40 private class UnclosedWaysCheck {40 private static class UnclosedWaysCheck { 41 41 /** The unique numeric code for this check */ 42 42 public final int code; … … 90 90 * Returns the test error of the given way, if any. 91 91 * @param w The way to check 92 * @param test parent test 92 93 * @return The test error if the way is erroneous, {@code null} otherwise 93 94 */ 94 public final TestError getTestError(Way w ) {95 public final TestError getTestError(Way w, UnclosedWays test) { 95 96 String value = w.get(key); 96 97 if (isValueErroneous(value)) { … … 99 100 String etype = engMessage.contains("{0}") ? MessageFormat.format(engMessage, value) : engMessage; 100 101 // CHECKSTYLE.ON: SingleSpaceSeparator 101 return new TestError( UnclosedWays.this, Severity.WARNING, tr("Unclosed way"),102 return new TestError(test, Severity.WARNING, tr("Unclosed way"), 102 103 type, etype, code, Arrays.asList(w), 103 104 // The important parts of an unclosed way are the first and … … 117 118 * @since 6390 118 119 */ 119 private final class UnclosedWaysBooleanCheck extends UnclosedWaysCheck {120 private static final class UnclosedWaysBooleanCheck extends UnclosedWaysCheck { 120 121 121 122 /** … … 137 138 } 138 139 139 private final UnclosedWaysCheck[] checks = {140 private static final UnclosedWaysCheck[] checks = { 140 141 // CHECKSTYLE.OFF: SingleSpaceSeparator 141 142 new UnclosedWaysCheck(1101, "natural", marktr("natural type {0}"), … … 183 184 184 185 for (UnclosedWaysCheck c : checks) { 185 TestError error = c.getTestError(w );186 TestError error = c.getTestError(w, this); 186 187 if (error != null) { 187 188 errors.add(error); -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r10680 r10755 683 683 } 684 684 685 private boolean handleNetworkErrors() {685 private static boolean handleNetworkErrors() { 686 686 boolean condition = !NETWORK_ERRORS.isEmpty(); 687 687 if (condition) { -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r10742 r10755 267 267 /** 268 268 * This class is an adapter for the old layer change interface. 269 * <p>270 * New implementations should use {@link org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener}271 269 * @author Michael Zangl 272 270 * @since 10271 273 */ 271 * @deprecated New implementations should use {@link org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener} 272 */ 273 @Deprecated 274 274 protected static class EditLayerChangeAdapter implements ActiveLayerChangeListener { 275 275 … … 326 326 */ 327 327 private static class WarningLayerPainter implements LayerPainter { 328 boolean warningPrinted = false;328 boolean warningPrinted; 329 329 private final Layer layer; 330 330 -
trunk/src/org/openstreetmap/josm/gui/SideButton.java
r10611 r10755 85 85 if (action != null) { 86 86 propertyChangeListener = evt -> { 87 if ( javax.swing.Action.SMALL_ICON.equals(evt.getPropertyName())) {87 if (Action.SMALL_ICON.equals(evt.getPropertyName())) { 88 88 fixIcon(null); 89 89 } -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r10627 r10755 173 173 } 174 174 175 private List<TileSource> getAllTileSources() {175 private static List<TileSource> getAllTileSources() { 176 176 List<TileSource> tileSources = new ArrayList<>(); 177 177 for (TileSourceProvider provider: providers) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r10680 r10755 468 468 public void performTagEdit() { 469 469 String value = Tag.removeWhiteSpaces(values.getEditor().getItem().toString()); 470 value = Normalizer.normalize(value, java.text.Normalizer.Form.NFC);470 value = Normalizer.normalize(value, Normalizer.Form.NFC); 471 471 if (value.isEmpty()) { 472 472 value = null; // delete the key 473 473 } 474 474 String newkey = Tag.removeWhiteSpaces(keys.getEditor().getItem().toString()); 475 newkey = Normalizer.normalize(newkey, java.text.Normalizer.Form.NFC);475 newkey = Normalizer.normalize(newkey, Normalizer.Form.NFC); 476 476 if (newkey.isEmpty()) { 477 477 newkey = key; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTransferHandler.java
r10604 r10755 58 58 } 59 59 60 private int computeInsertionRow(TransferSupport support, MemberTable destination) {60 private static int computeInsertionRow(TransferSupport support, MemberTable destination) { 61 61 final int insertRow; 62 62 if (support.isDrop()) { -
trunk/src/org/openstreetmap/josm/gui/history/SelectionSynchronizer.java
r10637 r10755 13 13 14 14 private final Set<ListSelectionModel> participants; 15 private boolean preventRecursion = false;15 private boolean preventRecursion; 16 16 17 17 /** -
trunk/src/org/openstreetmap/josm/gui/history/TagInfoTransferHandler.java
r10637 r10755 23 23 24 24 @Override 25 public void exportToClipboard(JComponent comp, Clipboard clip, int action) throws IllegalStateException{25 public void exportToClipboard(JComponent comp, Clipboard clip, int action) { 26 26 if (comp instanceof JTable) { 27 27 TableModel model = ((JTable) comp).getModel(); -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r10611 r10755 177 177 178 178 info.append(tr("Length: {0}", SystemOfMeasurement.getSystemOfMeasurement().getDistText(data.length()))).append("<br>") 179 .append(trn("{0} route, ", "{0} routes, ", data.routes.size(), data.routes.size())).append( 180 trn("{0} waypoint", "{0} waypoints", data.waypoints.size(), data.waypoints.size())).append("<br>") 181 .append("</html>"); 179 .append(trn("{0} route, ", "{0} routes, ", data.routes.size(), data.routes.size())) 180 .append(trn("{0} waypoint", "{0} waypoints", data.waypoints.size(), data.waypoints.size())).append("<br></html>"); 182 181 183 182 final JScrollPane sp = new JScrollPane(new HtmlPanel(info.toString())); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java
r10680 r10755 128 128 * @return non-editable table 129 129 */ 130 private JTable buildTable(Object[]... content) {130 private static JTable buildTable(Object[]... content) { 131 131 final String[] headers = {tr("Name"), tr("Description"), tr("Timespan"), tr("Length"), tr("URL")}; 132 132 DefaultTableModel model = new DefaultTableModel(content, headers); -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessor.java
r10547 r10755 68 68 } 69 69 70 private ConvolveOp generateMixed(float aFactor, float[] a, float[] b) {70 private static ConvolveOp generateMixed(float aFactor, float[] a, float[] b) { 71 71 if (a.length != 9 || b.length != 9) { 72 72 throw new IllegalArgumentException("Illegal kernel array length."); -
trunk/src/org/openstreetmap/josm/gui/widgets/ButtonColumn.java
r10547 r10755 29 29 private final JButton editButton; 30 30 private Object editorValue; 31 private String buttonName = null;31 private String buttonName; 32 32 33 33 /** -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r10671 r10755 274 274 protected String buildRequestString(final OsmPrimitiveType type, Set<Long> idPackage) { 275 275 return type.getAPIName() + "s?" + type.getAPIName() + "s=" + Utils.join(",", idPackage); 276 }277 278 @Override279 protected String getBaseUrl() {280 return super.getBaseUrl();281 276 } 282 277 -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r10746 r10755 291 291 protected List<ImageOverlay> overlayInfo; 292 292 /** <code>true</code> if icon must be grayed out */ 293 protected boolean isDisabled = false;293 protected boolean isDisabled; 294 294 295 295 private static SVGUniverse svgUniverse; -
trunk/src/org/openstreetmap/josm/tools/ImageResource.java
r10642 r10755 49 49 * <code>true</code> if icon must be grayed out 50 50 */ 51 protected boolean isDisabled = false;51 protected boolean isDisabled; 52 52 /** 53 53 * The base raster image for the final output
Note:
See TracChangeset
for help on using the changeset viewer.