#12437 closed defect (fixed)
support multiple etag values in `no-tile-header`
Reported by: | bastiK | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.02 |
Component: | Core imagery | Version: | |
Keywords: | Cc: |
Description
Currently, the following does not work:
<entry> <name>Mapbox Satellite</name> ... <no-tile-header name="ETag" value=""067736a547cafe90014b4e59b6510abe"" /> <no-tile-header name="ETag" value=""ee1f6802b0234046b553cbbc672ac7d9"" /> <no-tile-header name="ETag" value=""9f5a2f1d7cc131e58befc2052c71c827"" /> </entry>
It only respects the last entry.
(As a workaround one can use regexp, e.g.
<no-tile-header name='ETag' value='"067736a547cafe90014b4e59b6510abe"|"ee1f6802b0234046b553cbbc672ac7d9"|"9f5a2f1d7cc131e58befc2052c71c827"' />
)
Build-Date:2016-01-24 13:27:02 Revision:9576 Is-Local-Build:true Identification: JOSM/1.5 (9576 SVN en) Linux Ubuntu 14.04.3 LTS Memory Usage: 614 MB / 1764 MB (344 MB allocated, but free) Java version: 1.8.0_45-b14, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Attachments (0)
Change History (19)
comment:1 by , 9 years ago
Milestone: | → 16.02 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:3 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Preferences saving needs to be fixed.
comment:5 by , 9 years ago
Now only conversion of old preferences is needed. But as this setting is anyway overwritten with the Maps stuff maybe that's unnecessary?
comment:10 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
What about using MultiMap<String, String>
instead of Map<String, List<String>>
(→r9617)?
comment:11 by , 9 years ago
Ah I overlooked that we have our own implementation. Yes. Why not.
I'd leave the Prefs implementation of Map<String, List<String>>, as it does no harm.
Is MultiMap correctly handled in prefs?
comment:12 by , 9 years ago
I would stick to Map<String, List<String>>
as it uses only standard collections and does the same job as MultiMap
.
follow-ups: 14 16 comment:13 by , 9 years ago
The problem with supporting Map<String, String>
as well as Map<String, List<String>>
are unchecked assignments as demonstrated with testDeserializeStructTicket12474
in r9713. The shape of the string (in the preference XML file) determines the type in Java which leads to #12474/ClassCastException w/o any compiler error/warning.
comment:14 by , 9 years ago
Replying to simon04:
The problem with supporting
Map<String, String>
as well asMap<String, List<String>>
are unchecked assignments as demonstrated withtestDeserializeStructTicket12474
in r9713. The shape of the string (in the preference XML file) determines the type in Java which leads to #12474/ClassCastException w/o any compiler error/warning.
That's only an issue when like here the preferences are changed and not updated as I left out the rewriting of existing prefs. Simple solution is to add a rewrite of the old entry in our preferences update section. But I'm still not sure how the two reports managed to get into that state, as the wrong entry normally gets immediately overwritten with a new correct one from the maps file.
You failing test simply says: Our deserializer isn't stable against JSON not matching the expectations. That's independent from the question what structure we use.
comment:16 by , 9 years ago
Replying to simon04:
The problem with supporting
Map<String, String>
as well asMap<String, List<String>>
are unchecked assignments as demonstrated withtestDeserializeStructTicket12474
in r9713. The shape of the string (in the preference XML file) determines the type in Java which leads to #12474/ClassCastException w/o any compiler error/warning.
You are right, this doesn't work. It is kind of funny, we cannot even catch this kind of error proactively. Instead it will blow up somewhere in the calling code like a parcel bomb. This can be easily avoided by switching to MultiMap
(or any other class != Map
).
Type erasure is really one of the worst things in Java...
See #12425.