#6592 closed defect (fixed)
[Patch] IllegalArgumentException when viewing history of incomplete relation members
Reported by: | Don-vip | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- Select members of an incomplete relation
- Click on "Show" button of History view
What is the expected result? Don't know. Is it relevant to enable history of a member not downloaded ?
What happens instead? An ugly error popup window ;)
Please provide any additional information below. Attach a screenshot if
possible.
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2011-07-13 01:31:30 Last Changed Author: jttt Revision: 4229 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2011-07-12 20:47:58 +0200 (Tue, 12 Jul 2011) Last Changed Rev: 4229 Identification: JOSM/1.5 (4229 fr) Memory Usage: 201 MB / 3729 MB (48 MB allocated, but free) Java version: 1.6.0_26, Sun Microsystems Inc., Java HotSpot(TM) 64-Bit Server VM Operating system: Windows 7 Dataset consistency test: No problems found Plugin: OpeningHoursEditor (26284) Plugin: RoadSigns (26174) Plugin: cadastre-fr (26284) Plugin: epci-fr (26282) Plugin: openstreetbugs (26299) Plugin: photo_geotagging (26174) Plugin: proj4j (26174) Plugin: public_transport (26284) Plugin: restart (26254) java.lang.IllegalArgumentException: Parameter 'version' > 0 expected. Got '0'. at org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive.ensurePositiveLong(HistoryOsmPrimitive.java:36) at org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive.<init>(HistoryOsmPrimitive.java:54) at org.openstreetmap.josm.data.osm.history.HistoryNode.<init>(HistoryNode.java:20) at org.openstreetmap.josm.gui.history.HistoryBrowserModel$HistoryPrimitiveBuilder.visit(HistoryBrowserModel.java:880) at org.openstreetmap.josm.data.osm.Node.visit(Node.java:185) at org.openstreetmap.josm.gui.history.HistoryBrowserModel$HistoryPrimitiveBuilder.build(HistoryBrowserModel.java:902) at org.openstreetmap.josm.gui.history.HistoryBrowserModel.setHistory(HistoryBrowserModel.java:175) at org.openstreetmap.josm.gui.history.HistoryBrowser.populate(HistoryBrowser.java:127) at org.openstreetmap.josm.gui.history.HistoryBrowserDialog.setHistory(HistoryBrowserDialog.java:107) at org.openstreetmap.josm.gui.history.HistoryBrowserDialog.<init>(HistoryBrowserDialog.java:96) at org.openstreetmap.josm.gui.history.HistoryBrowserDialogManager.show(HistoryBrowserDialogManager.java:107) at org.openstreetmap.josm.gui.dialogs.HistoryDialog$ShowHistoryAction$1.run(HistoryDialog.java:365) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
Attachments (1)
Change History (9)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
I can confirm this is still happening in r4279.
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2011-08-01 01:31:34 Last Changed Author: stoecker Revision: 4279 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2011-07-31 23:52:49 +0200 (Sun, 31 Jul 2011) Last Changed Rev: 4279 Identification: JOSM/1.5 (4279 en) Memory Usage: 204 MB / 3640 MB (81 MB allocated, but free) Java version: 1.6.0_26, Sun Microsystems Inc., Java HotSpot(TM) 64-Bit Server VM Operating system: Windows 7 Dataset consistency test: No problems found Plugin: OpeningHoursEditor (26284) Plugin: buildings_tools (26254) Plugin: imageryadjust (26174) Plugin: licensechange (26377) Plugin: mapdust (26174) Plugin: measurement (26174) Plugin: michigan_left (26174) Plugin: openstreetbugs (26299) Plugin: restart (26254) Plugin: reverter (26254) Plugin: turnlanes (26316) Plugin: turnrestrictions (26299) Plugin: undelete (26254) Plugin: utilsplugin2 (26395) java.lang.IllegalArgumentException: Parameter 'version' > 0 expected. Got '0'. at org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive.ensurePositiveLong(HistoryOsmPrimitive.java:36) at org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive.<init>(HistoryOsmPrimitive.java:54) at org.openstreetmap.josm.data.osm.history.HistoryWay.<init>(HistoryWay.java:22) at org.openstreetmap.josm.gui.history.HistoryBrowserModel$HistoryPrimitiveBuilder.visit(HistoryBrowserModel.java:894) at org.openstreetmap.josm.data.osm.Way.visit(Way.java:161) at org.openstreetmap.josm.gui.history.HistoryBrowserModel$HistoryPrimitiveBuilder.build(HistoryBrowserModel.java:902) at org.openstreetmap.josm.gui.history.HistoryBrowserModel.setHistory(HistoryBrowserModel.java:175) at org.openstreetmap.josm.gui.history.HistoryBrowser.populate(HistoryBrowser.java:127) at org.openstreetmap.josm.gui.history.HistoryBrowserDialog.setHistory(HistoryBrowserDialog.java:107) at org.openstreetmap.josm.gui.history.HistoryBrowserDialog.<init>(HistoryBrowserDialog.java:96) at org.openstreetmap.josm.gui.history.HistoryBrowserDialogManager.show(HistoryBrowserDialogManager.java:107) at org.openstreetmap.josm.gui.dialogs.HistoryDialog$ShowHistoryAction$1.run(HistoryDialog.java:365) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
by , 13 years ago
Attachment: | 6592.patch added |
---|
comment:3 by , 13 years ago
Summary: | IllegalArgumentException when viewing history of incomplete relation members → [Patch] IllegalArgumentException when viewing history of incomplete relation members |
---|
Patch attached. Allows showing the history for incomplete members or with missing version (e.g. data from OverpassAPI). :-)
Please test and report with example OSM file.
follow-up: 6 comment:5 by , 13 years ago
In the rare cases where we have set/get (setCoor() in this case) please don't dis-use them :-)
comment:6 by , 13 years ago
Replying to stoecker:
In the rare cases where we have set/get (setCoor() in this case) please don't dis-use them :-)
I found it unusual to use setters in constructors. For instance, the automatically generated constructors by Netbeans are of the shape this.x = x;
. I found this on Stack Overflow: http://stackoverflow.com/questions/4893558/calling-setters-from-a-constructor
comment:7 by , 13 years ago
JOSM does not follow the Java suggestion to use setters/getters for all variables. So when we have setters/getters this usually means we want an additional abstraction level. Using both setters/getters and direct assignment is dangerous in cases where this additional abstraction is used later to change the way these functions are implemented. In these cases the direct assignments are easily overlooked.
So while the stuff in your link is valid, for me usually the most important part is to not use two mechanisms in parallel. The general advice: Don't do things which other programmers do not expect :-)
I have the same error if I try to look at the history of an element obtained from the Overpass API, and not updated after.
I think the "view history" should be disabled in that case.