#7789 closed defect (fixed)
Map icons sometimes disapear after an "Update Data" command
| Reported by: | rickmastfan67 | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Component: | Internal mappaint style |
| Version: | latest | Keywords: | |
| Cc: |
Description
Steps to reproduce:
- Download the following area:
minlat: 40.4515984 --- min lon: -79.1456171 maxlat: 40.4533673 --- max lon: -79.1422074
- Once downloaded, search for the way "116,915,565" and select it. (on the left of the screen of downloaded data)
- Once selected, look at the properties and scroll down to the bottom and see that the way is part of a "no_u_turn" restriction.
- Look at the map and notice that the "No-U-Turn" icon is missing.
I've been able to duplicate this every time I've tested in [5281] & [5278] without fail AS LONG AS I download the same bounding box area. If I just download the small area that the problem is happening in, it doesn't happen.
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2012-06-11 01:31:17 Last Changed Author: simon04 Revision: 5278 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2012-06-11 00:17:12 +0200 (Mon, 11 Jun 2012) Last Changed Rev: 5278 Identification: JOSM/1.5 (5278 en) Memory Usage: 150 MB / 2730 MB (92 MB allocated, but free) Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Operating system: Windows 7 Dataset consistency test: No problems found Plugin: turnrestrictions (28412)
Attachments (3)
Change History (33)
comment:1 Changed 11 months ago by rickmastfan67
comment:2 Changed 11 months ago by rickmastfan67
I'm starting to think this might be because of Java 1.7, as I never had this problem with Java 1.6.
Can anybody else confirm this who is running Java 1.7?
comment:3 Changed 11 months ago by rickmastfan67
- Summary changed from Map icons sometimes don't get displayed after downloading data to Map icons sometimes disapear after an "Update Data" command
Nobody else has had this problem? I'm even able to duplicate it (not to the same extent as with my normal profile) with a clean profile with no plugins downloaded/installed.
Alright, here's some better steps to reproducing this with a clean profile and the file that I'm going to attach after this post.
- Delete your profile (or just rename the folder) so that JOSM will create a new profile for you when it's started.
- Start JOSM and let it create the new profile.
- Close and restart JOSM.
- Once JOSM has started again, open the attached file, "bug zone.osm" (will be compressed, so uncompress it first) via the File > Open command (Ctrl+O).
- Once the file has opened, Ctrl+F, select the "replace selection", and paste in the following text into the text bar and then hit the Start Search button: Fanny Edel Falk Laboratory School
- File > Update Data
- Notice that the school icon has disappeared for "Fanny Edel Falk Laboratory School".
I can duplicate this 100% of the time. In some other files, all icons completely disappear, but I wanted to attach a file that I wasn't editing currently and one that might not have anything new added in it's area in the near future that would throw up conflicts.
Anyways, this is really annoying me when I hit the that "Update Data" button to see the icons disappear. So, with the steps above and the file I've attached, can anybody now duplicate this? You must be running Java 1.7 because this never happened with 1.6. Hopefully this isn't a bug that is on Java's end only and is something that can be fixed on this end to work with Java 1.7 properly.
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2012-06-30 01:31:12 Last Changed Author: Don-vip Revision: 5309 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2012-06-29 22:12:06 +0200 (Fri, 29 Jun 2012) Last Changed Rev: 5309 Identification: JOSM/1.5 (5309 en) Memory Usage: 154 MB / 2730 MB (121 MB allocated, but free) Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Operating system: Windows 7
Changed 11 months ago by rickmastfan67
comment:4 Changed 11 months ago by bastiK
Cannot reproduce on my system.
Build-Date: 2012-06-19 23:45:51 Revision: 5283 Is-Local-Build: true Identification: JOSM/1.5 (5283 SVN en) Memory Usage: 281 MB / 1767 MB (249 MB allocated, but free) Java version: 1.7.0_147-icedtea, Oracle Corporation, OpenJDK 64-Bit Server VM Operating system: Linux
comment:5 follow-up: ↓ 6 Changed 11 months ago by rickmastfan67
Anybody else out there using Windows having this happening?
comment:6 in reply to: ↑ 5 Changed 11 months ago by Don-vip
Replying to rickmastfan67:
Anybody else out there using Windows having this happening?
Yes, I just reproduced it by running your steps 4 to 7. Now, why this is happening...
Build-Date: 2012-07-01 14:53:54 Revision: 5313 Is-Local-Build: true Identification: JOSM/1.5 (5313 SVN fr) Memory Usage: 181 MB / 1816 MB (65 MB allocated, but free) Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Operating system: Windows 7
Changed 11 months ago by Don-vip
Changed 11 months ago by Don-vip
comment:7 Changed 11 months ago by Don-vip
comment:8 Changed 11 months ago by rickmastfan67
I also see that the "Hospital" icon disappeared as well in your test on the left of the screen. That icon wasn't disappearing in my tests. (I've more often seen "highway" related icons disappear, like traffic lights, stop signs, and turn restriction icons when I've been doing editing.)
Hopefully the bug that is causing this to happen can be identified now since you've been able to duplicate it Don. :)
comment:9 follow-up: ↓ 10 Changed 11 months ago by bastiK
@Don-vip: For debugging you can have a look at the second tab of "Advanced object info" (Ctrl+I) before and after update.
comment:10 in reply to: ↑ 9 ; follow-up: ↓ 12 Changed 11 months ago by Don-vip
Replying to bastiK:
@Don-vip: For debugging you can have a look at the second tab of "Advanced object info" (Ctrl+I) before and after update.
Thanks. Before:
Styles Cache for "Fanny Edel Falk Laboratory School ?(40.4471711, -79.9594584) [id: 1,668,195,992]":
> applying xml style "JOSM"
Range:|s0.0-Infinity
default:
Cascade{ }
> skipping "Potlatch 2" (not active)
> applying mapcss style "Registre Parcellaire Graphique (France)"
Range:|s0.0-Infinity
default:
Cascade{ }
List of generated Styles:
* NodeElemStyle{z_idx=[4.0/0.0/0.0] icon=[education/school.png]}
* BoxTextElemStyle{z_idx=[5.0/0.0/0.0] labelCompositionStrategy={DeriveLabelFromNameTagsCompositionStrategy} font=java.awt.Font[family=Dialog,name=Helvetica,style=plain,size=8] color=#ffffff box=java.awt.Rectangle[x=-8,y=-8,width=16,height=16] hAlign=RIGHT vAlign=BOTTOM}
After:
Styles Cache for "Fanny Edel Falk Laboratory School ?(40.4471711, -79.9594584) [id: 1,668,195,992]":
> applying xml style "JOSM"
Range:|s0.0-Infinity
default:
Cascade{ text:Keyword{auto}; icon-image:IconReference{iconName='education/school.png' source='JOSM'}; }
> skipping "Potlatch 2" (not active)
> applying mapcss style "Registre Parcellaire Graphique (France)"
Range:|s0.0-Infinity
default:
Cascade{ text:Keyword{auto}; icon-image:IconReference{iconName='education/school.png' source='JOSM'}; }
List of generated Styles:
* NodeElemStyle{z_idx=[4.1/0.0/0.0] }
* BoxTextElemStyle{z_idx=[5.0/0.0/0.0] labelCompositionStrategy={DeriveLabelFromNameTagsCompositionStrategy} font=java.awt.Font[family=Dialog,name=Helvetica,style=plain,size=8] color=#ffffff box=java.awt.Rectangle[x=-2,y=-2,width=5,height=5] hAlign=RIGHT vAlign=BOTTOM}
comment:11 Changed 11 months ago by rickmastfan67
Don't know if this will help, but in one file I'm working on, an intersection of a divided highway that has traffic lights is showing some weird behavior. One traffic light icon is showing up, yet the other one isn't. Hope this "Advanced Info" from those two nodes will help out:
Styles Cache for "1811117129 (40.3955211, -79.4419837) [id: 1,811,117,129]":
> applying xml style "Internal Style"
Range:|s0.0-Infinity
default:
Cascade{ }
> skipping "Potlatch 2" (not active)
> skipping "Maxspeed" (not active)
List of generated Styles:
* NodeElemStyle{z_idx=[4.1/0.0/0.0] }
Styles Cache for "1811117115 (40.3954117, -79.4419795) [id: 1,811,117,115]":
> applying xml style "Internal Style"
Range:|s0.0-Infinity
default:
Cascade{ }
> skipping "Potlatch 2" (not active)
> skipping "Maxspeed" (not active)
List of generated Styles:
* NodeElemStyle{z_idx=[4.0/0.0/0.0] icon=[vehicle/restriction/traffic-light.png]}
The 2 selected objects have different style caches.
comment:12 in reply to: ↑ 10 Changed 11 months ago by bastiK
Replying to Don-vip:
Replying to bastiK:
@Don-vip: For debugging you can have a look at the second tab of "Advanced object info" (Ctrl+I) before and after update.
Thanks. Before:
Styles Cache for "Fanny Edel Falk Laboratory School ?(40.4471711, -79.9594584) [id: 1,668,195,992]": > applying xml style "JOSM" Range:|s0.0-Infinity default: Cascade{ } > skipping "Potlatch 2" (not active) > applying mapcss style "Registre Parcellaire Graphique (France)" Range:|s0.0-Infinity default: Cascade{ } List of generated Styles: * NodeElemStyle{z_idx=[4.0/0.0/0.0] icon=[education/school.png]} * BoxTextElemStyle{z_idx=[5.0/0.0/0.0] labelCompositionStrategy={DeriveLabelFromNameTagsCompositionStrategy} font=java.awt.Font[family=Dialog,name=Helvetica,style=plain,size=8] color=#ffffff box=java.awt.Rectangle[x=-8,y=-8,width=16,height=16] hAlign=RIGHT vAlign=BOTTOM}
There are already errors in the "Before" part: An empty cascade is created, but still an icon is derived from that in the style list. This is impossible, because only the information from the final cascade is used to generate the styles. So the code that generates the cascade seems to have different results depending on some unkown condition, although the tags and the style definitions are unchanged.
comment:13 follow-up: ↓ 14 Changed 10 months ago by rickmastfan67
Any luck on figuring this out Don?
comment:14 in reply to: ↑ 13 Changed 10 months ago by Don-vip
Replying to rickmastfan67:
Any luck on figuring this out Don?
Not yet, sorry, I still have to find enough hours ahead in my planning to investigate this problem in depth. I am afraid of its complexity, especially because I am not enough familiar (yet) with the cascade-styled rendering. But I did not forget you, I promise :)
comment:15 Changed 10 months ago by bastiK
One possible reason could be errors in equals and hashCode methods.
comment:16 Changed 8 months ago by stoecker
See also #8101.
comment:17 Changed 8 months ago by bastiK
Ticket #8101 has been marked as a duplicate of this ticket.
comment:18 Changed 8 months ago by bastiK
In 5530/josm:
comment:19 Changed 8 months ago by bastiK
Could reproduce in Windows 7 / Java 7.
It is quite strange, very basic commands aren't executed the way I expect them to. In particular the line
return requiresUpdate(current, candidate, scale, mc) ? candidate : current;
in [5530] is weird. My debug output confirms, that requiresUpdate returns true and that candidate is != null, however the whole expression evaluates to null. As soon as I do the trivial rework [5530], the problem goes away completely on my system.
Please check, whether the bug is fixed!
comment:20 follow-up: ↓ 22 Changed 8 months ago by Don-vip
Very weird. The only difference I could find between ternary operator and if/else statement is this one:
http://stackoverflow.com/questions/8098953/tricky-ternary-operator-in-java-autoboxing
But this does not concern our case :( I'd like to understand !
comment:21 Changed 8 months ago by rickmastfan67
Just tested this in the two locations I mentioned that were having this problem. Couldn't get the icons to disappear, so, I think this is now fixed.
comment:22 in reply to: ↑ 20 Changed 8 months ago by bastiK
- Resolution set to fixed
- Status changed from new to closed
Replying to Don-vip:
Very weird. The only difference I could find between ternary operator and if/else statement is this one:
http://stackoverflow.com/questions/8098953/tricky-ternary-operator-in-java-autoboxing
But this does not concern our case :( I'd like to understand !
The problem is, that debugging makes it go away. This usually happens in multi-threading environment for race conditions, but here it seems to be all local and one line of execution. Please tell, if you get any more insights!
comment:23 follow-up: ↓ 24 Changed 8 months ago by stoecker
Can you compile a java bug report? I think this may cause other troubles as well, so probably a java bug report is the better idea than fixing this again and again in josm :-)
comment:24 in reply to: ↑ 23 Changed 8 months ago by bastiK
Replying to stoecker:
Can you compile a java bug report? I think this may cause other troubles as well, so probably a java bug report is the better idea than fixing this again and again in josm :-)
Done.
I trimmed it down further:
private String returnSecond(String first, String second) { return alwaysTrue() ? second : first; } private boolean alwaysTrue() { return true; } private IconPrototype getNode(OsmPrimitive primitive, Double scale, MultiCascade mc) { if (primitive.getId() == 746457511) { String test = returnSecond(null, "second"); System.err.println("test: " + test); } [...] }
Output:
Open file: C:\Users\te\Downloads\aaaa.osm (690139 bytes) test: second GET http://api.openstreetmap.org/api/0.6/map?bbox=14.1311646,51.2202174,14.1445541,51.2294629 test: null
It should be pretty obvious, that something is seriously wrong here. However, I cannot provide a small self-contained test case, so I'm not sure whether Oracle will accept my bug report.
comment:25 Changed 7 months ago by rickmastfan67
bastiK, just curious, but did Oracle ever accept the bug report?
comment:26 Changed 7 months ago by bastiK
No reaction so far (except for automatic confirmation mail).
comment:27 Changed 7 months ago by Don-vip
Did you receive a bug ID in the confirmation mail ?
comment:28 Changed 7 months ago by bastiK
No, just an internal review ID.
comment:29 Changed 7 months ago by stoecker
Like my first and last try to report a java bug. Automatic response was all I got.
comment:30 Changed 7 months ago by Don-vip
You were unlucky, the two only bugs I submitted to Oracle did eventually show on public tracker, even one that has been closed as "not an issue":
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7158257
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7194099





Also, if I delete the downloaded layer and then re-download the data (WITHOUT closing and restarting JOSM), more icons disappear. To be more specific, the other "No-U-Turn" restriction icon for the other direction of US-22 disappears as well as the stop icon for a node tagged "highway=stop" in the same area as the missing No-U-Turn icon from the beginning.