Changeset 31795 in osm for applications/editors/josm/plugins/mapillary/src/org/openstreetmap
- Timestamp:
- 2015-12-03T22:27:47+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtils.java
r31787 r31795 37 37 "Bearer " + Main.pref.get("mapillary.access-token")); 38 38 39 BufferedReader in = new BufferedReader(new InputStreamReader( 40 con.getInputStream())); 41 return Json.createReader(in).readObject(); 39 try ( 40 BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())) 41 ) { 42 return Json.createReader(in).readObject(); 43 } 42 44 } 43 45 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/traffico/TrafficoGlyph.java
r31793 r31795 10 10 import javax.json.JsonReader; 11 11 12 public class TrafficoGlyph { 12 public final class TrafficoGlyph { 13 13 private TrafficoGlyph() { 14 14 // private constructor to avoid instantiation -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/traffico/TrafficoSign.java
r31787 r31795 9 9 import java.util.Map; 10 10 import java.util.Set; 11 import java.util.TreeMap;12 11 13 12 import javax.json.Json; … … 15 14 import javax.json.JsonObject; 16 15 17 public class TrafficoSign { 18 private static final Map<String, String> isIn = new TreeMap<>(); 19 20 static { 21 isIn.put("be", "europe"); 22 isIn.put("de", "europe"); 23 isIn.put("dk", "europe"); 24 isIn.put("es", "europe"); 16 public final class TrafficoSign { 17 private TrafficoSign() { 18 // private constructor to avoid instantiation 25 19 } 26 20 … … 31 25 System.out.println("Read signs for " + country); 32 26 InputStream countryStream = TrafficoSign.class 33 .getResourceAsStream("/data/fonts/traffico/signs/" + country 34 + ".json"); 27 .getResourceAsStream("/data/fonts/traffico/signs/" + country + ".json"); 35 28 if (countryStream == null) { 36 29 return null; … … 89 82 return signs.get(country).get(signName); 90 83 } 91 if (isIn.containsKey(country)) {92 return TrafficoSign.getSign(isIn.get(country), signName);93 }94 84 return null; 95 85 }
Note:
See TracChangeset
for help on using the changeset viewer.