Changeset 12620 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2017-08-22T22:26:32+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r12542 r12620 55 55 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 56 56 import org.openstreetmap.josm.tools.ListenerList; 57 import org.openstreetmap.josm.tools.Logging; 57 58 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 58 59 … … 1010 1011 OsmPrimitive result = getPrimitiveById(primitiveId); 1011 1012 if (result == null && primitiveId != null) { 1012 Main.warn(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this "1013 Logging.warn(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this " 1013 1014 + "at {2}. This is not a critical error, it should be safe to continue in your work.", 1014 1015 primitiveId.getType(), Long.toString(primitiveId.getUniqueId()), Main.getJOSMWebsite())); 1015 Main.error(new Exception());1016 Logging.error(new Exception()); 1016 1017 } 1017 1018 -
trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
r11746 r12620 8 8 import java.io.Writer; 9 9 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.tools.JosmRuntimeException; 11 import org.openstreetmap.josm.tools.Logging; 12 12 import org.openstreetmap.josm.tools.Utils; 13 13 … … 186 186 187 187 private void printElapsedTime(long startTime) { 188 if ( Main.isDebugEnabled()) {188 if (Logging.isDebugEnabled()) { 189 189 StackTraceElement item = Thread.currentThread().getStackTrace()[2]; 190 190 String operation = getClass().getSimpleName() + '.' + item.getMethodName(); 191 191 long elapsedTime = System.currentTimeMillis() - startTime; 192 Main.debug(tr("Test ''{0}'' completed in {1}",192 Logging.debug(tr("Test ''{0}'' completed in {1}", 193 193 operation, Utils.getDurationString(elapsedTime))); 194 194 } … … 216 216 writer.println("Exception during dataset integrity test:"); 217 217 e.printStackTrace(writer); 218 Main.warn(e);218 Logging.warn(e); 219 219 } 220 220 } -
trunk/src/org/openstreetmap/josm/data/osm/FilterModel.java
r12414 r12620 21 21 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 22 22 import org.openstreetmap.josm.gui.widgets.OSDLabel; 23 import org.openstreetmap.josm.tools.Logging; 23 24 import org.openstreetmap.josm.tools.Utils; 24 25 … … 51 52 filterMatcher.add(filter); 52 53 } catch (ParseError e) { 53 Main.error(e);54 Logging.error(e); 54 55 JOptionPane.showMessageDialog( 55 56 Main.parent, -
trunk/src/org/openstreetmap/josm/data/osm/MultipolygonBuilder.java
r11119 r12620 23 23 import java.util.stream.Collectors; 24 24 25 import org.openstreetmap.josm.Main;26 25 import org.openstreetmap.josm.tools.CheckParameterUtil; 27 26 import org.openstreetmap.josm.tools.Geometry; 28 27 import org.openstreetmap.josm.tools.Geometry.PolygonIntersection; 28 import org.openstreetmap.josm.tools.Logging; 29 29 import org.openstreetmap.josm.tools.MultiMap; 30 30 import org.openstreetmap.josm.tools.Pair; … … 203 203 return makeFromPolygons(joinedWays); 204 204 } catch (JoinedPolygonCreationException ex) { 205 Main.debug(ex);205 Logging.debug(ex); 206 206 return ex.getMessage(); 207 207 } -
trunk/src/org/openstreetmap/josm/data/osm/NoteData.java
r12540 r12620 17 17 import org.openstreetmap.josm.gui.JosmUserIdentityManager; 18 18 import org.openstreetmap.josm.tools.ListenerList; 19 import org.openstreetmap.josm.tools.Logging; 19 20 20 21 /** … … 137 138 } else { 138 139 // TODO merge comments? 139 Main.info("Keeping existing note id={0} with uncommitted changes", String.valueOf(newNote.getId()));140 Logging.info("Keeping existing note id={0} with uncommitted changes", String.valueOf(newNote.getId())); 140 141 } 141 142 } … … 162 163 NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.OPENED, true); 163 164 note.addComment(comment); 164 if ( Main.isDebugEnabled()) {165 Main.debug("Created note {0} with comment: {1}", note.getId(), text);165 if (Logging.isDebugEnabled()) { 166 Logging.debug("Created note {0} with comment: {1}", note.getId(), text); 166 167 } 167 168 noteList.add(note); … … 181 182 throw new IllegalStateException("Cannot add a comment to a closed note"); 182 183 } 183 if ( Main.isDebugEnabled()) {184 Main.debug("Adding comment to note {0}: {1}", note.getId(), text);184 if (Logging.isDebugEnabled()) { 185 Logging.debug("Adding comment to note {0}: {1}", note.getId(), text); 185 186 } 186 187 NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.COMMENTED, true); … … 201 202 throw new IllegalStateException("Cannot close a note that isn't open"); 202 203 } 203 if ( Main.isDebugEnabled()) {204 Main.debug("closing note {0} with comment: {1}", note.getId(), text);204 if (Logging.isDebugEnabled()) { 205 Logging.debug("closing note {0} with comment: {1}", note.getId(), text); 205 206 } 206 207 NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.CLOSED, true); … … 223 224 throw new IllegalStateException("Cannot reopen a note that isn't closed"); 224 225 } 225 if (Main.isDebugEnabled()) { 226 Main.debug("reopening note {0} with comment: {1}", note.getId(), text); 227 } 226 Logging.debug("reopening note {0} with comment: {1}", note.getId(), text); 228 227 NoteComment comment = new NoteComment(new Date(), getCurrentUser(), text, NoteComment.Action.REOPENED, true); 229 228 note.addComment(comment); -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r12190 r12620 27 27 import org.openstreetmap.josm.gui.mappaint.StyleCache; 28 28 import org.openstreetmap.josm.tools.CheckParameterUtil; 29 import org.openstreetmap.josm.tools.Logging; 29 30 import org.openstreetmap.josm.tools.Utils; 30 31 import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider; … … 761 762 return SearchCompiler.compile(Main.pref.get(prefName, defaultValue)); 762 763 } catch (ParseError e) { 763 Main.error(e, "Unable to compile pattern for " + prefName + ", trying default pattern:");764 Logging.log(Logging.LEVEL_ERROR, "Unable to compile pattern for " + prefName + ", trying default pattern:", e); 764 765 } 765 766 -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r12537 r12620 10 10 import java.util.NoSuchElementException; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.coor.LatLon; 14 13 import org.openstreetmap.josm.data.coor.QuadTiling; 14 import org.openstreetmap.josm.tools.Logging; 15 15 16 16 /** … … 598 598 if (searchCache == null) { 599 599 searchCache = root; 600 Main.info("bbox: " + searchBbox + " is out of the world");600 Logging.info("bbox: " + searchBbox + " is out of the world"); 601 601 } 602 602 -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r12549 r12620 22 22 import java.util.stream.Stream; 23 23 24 import org.openstreetmap.josm. Main;24 import org.openstreetmap.josm.tools.Logging; 25 25 import org.openstreetmap.josm.tools.Utils; 26 26 … … 725 725 result += Integer.parseInt(value); 726 726 } catch (NumberFormatException e) { 727 Main.trace(e);727 Logging.trace(e); 728 728 } 729 729 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r11878 r12620 13 13 import java.util.Objects; 14 14 15 import org.openstreetmap.josm.Main;16 15 import org.openstreetmap.josm.data.osm.Changeset; 17 16 import org.openstreetmap.josm.data.osm.Node; … … 26 25 import org.openstreetmap.josm.data.osm.Way; 27 26 import org.openstreetmap.josm.tools.CheckParameterUtil; 27 import org.openstreetmap.josm.tools.Logging; 28 28 import org.openstreetmap.josm.tools.date.DateUtils; 29 29 … … 354 354 data.setVisible(visible); 355 355 } catch (IllegalStateException e) { 356 Main.error(e, "Cannot change visibility for "+data+':');356 Logging.log(Logging.LEVEL_ERROR, "Cannot change visibility for "+data+':', e); 357 357 } 358 358 data.setTimestamp(timestamp); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r11992 r12620 20 20 import org.openstreetmap.josm.gui.NavigatableComponent; 21 21 import org.openstreetmap.josm.tools.CheckParameterUtil; 22 import org.openstreetmap.josm.tools.Logging; 22 23 23 24 /** … … 157 158 // On read, it would first check, if the way still has firstIdx+2 nodes, then check if the corresponding way nodes are still 158 159 // the same and report changes in a more controlled manner. 159 Main.trace(e);160 Logging.trace(e); 160 161 } 161 162 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r12279 r12620 17 17 import org.openstreetmap.josm.plugins.PluginHandler; 18 18 import org.openstreetmap.josm.tools.CheckParameterUtil; 19 import org.openstreetmap.josm.tools.Logging; 19 20 20 21 /** … … 138 139 return Class.forName(className, true, cl); 139 140 } catch (final NoClassDefFoundError | ClassNotFoundException e) { 140 Main.trace(e);141 Logging.trace(e); 141 142 } 142 143 } 143 Main.error(tr("Failed to load map renderer class ''{0}''. The class wasn''t found.", className));144 Logging.error(tr("Failed to load map renderer class ''{0}''. The class wasn''t found.", className)); 144 145 return null; 145 146 } … … 161 162 Class<?> c = loadRendererClass(rendererClassName); 162 163 if (c == null) { 163 Main.error(tr("Can''t activate map renderer class ''{0}'', because the class wasn''t found.", rendererClassName));164 Main.error(tr("Activating the standard map renderer instead."));164 Logging.error(tr("Can''t activate map renderer class ''{0}'', because the class wasn''t found.", rendererClassName)); 165 Logging.error(tr("Activating the standard map renderer instead.")); 165 166 activateDefault(); 166 167 } else if (!AbstractMapRenderer.class.isAssignableFrom(c)) { 167 Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.",168 Logging.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.", 168 169 rendererClassName, AbstractMapRenderer.class.getName())); 169 Main.error(tr("Activating the standard map renderer instead."));170 Logging.error(tr("Activating the standard map renderer instead.")); 170 171 activateDefault(); 171 172 } else { 172 173 Class<? extends AbstractMapRenderer> renderer = c.asSubclass(AbstractMapRenderer.class); 173 174 if (!isRegistered(renderer)) { 174 Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", rendererClassName)); 175 Main.error(tr("Activating the standard map renderer instead.")); 175 Logging.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", 176 rendererClassName)); 177 Logging.error(tr("Activating the standard map renderer instead.")); 176 178 activateDefault(); 177 179 } else { … … 306 308 return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode)); 307 309 } catch (InvocationTargetException e) { 308 Main.debug(e);310 Logging.debug(e); 309 311 throw new MapRendererFactoryException(e.getCause()); 310 312 } catch (ReflectiveOperationException | IllegalArgumentException e) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/RenderBenchmarkCollector.java
r11726 r12620 9 9 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.StyleRecord; 10 10 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector; 11 import org.openstreetmap.josm.tools.Logging; 11 12 import org.openstreetmap.josm.tools.Utils; 12 13 … … 147 148 */ 148 149 public static Supplier<RenderBenchmarkCollector> defaultBenchmarkSupplier() { 149 return () -> Main.isTraceEnabled() || Main.pref.getBoolean("mappaint.render.benchmark", false)150 return () -> Logging.isTraceEnabled() || Main.pref.getBoolean("mappaint.render.benchmark", false) 150 151 ? new LoggingBenchmark() : new RenderBenchmarkCollector(); 151 152 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r12539 r12620 241 241 gv.setGlyphTransform(0, AffineTransform.getTranslateInstance(1000, 1000)); 242 242 Shape shape = gv.getGlyphOutline(0); 243 if ( Main.isTraceEnabled()) {244 Main.trace("#10446: shape: "+shape.getBounds());243 if (Logging.isTraceEnabled()) { 244 Logging.trace("#10446: shape: {0}", shape.getBounds()); 245 245 } 246 246 // x is about 1000 on normal stystems and about 2000 when the bug occurs … … 1129 1129 (p1, p2) -> p1.append(p2, false)), 1130 1130 osm.isDisabled(), text); 1131 } else if (Main.isTraceEnabled()){1132 Main.trace("Couldn't find a correct label placement for " + osm + " / " +name);1131 } else { 1132 Logging.trace("Couldn't find a correct label placement for {0} / {1}", osm, name); 1133 1133 } 1134 1134 }); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r12189 r12620 30 30 import org.openstreetmap.josm.tools.Geometry; 31 31 import org.openstreetmap.josm.tools.Geometry.AreaAndPerimeter; 32 import org.openstreetmap.josm.tools.Logging; 32 33 33 34 /** … … 405 406 if (ds == null) { 406 407 // DataSet still not found. This should not happen, but a warning does no harm 407 Main.warn("DataSet not found while resetting nodes in Multipolygon. " +408 Logging.warn("DataSet not found while resetting nodes in Multipolygon. " + 408 409 "This should not happen, you may report it to JOSM developers."); 409 410 } else if (wayIds.size() == 1) {
Note:
See TracChangeset
for help on using the changeset viewer.