Changeset 5834 in josm for trunk/src/org
- Timestamp:
- 2013-04-07T19:56:52+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r5275 r5834 37 37 public String read(String url) throws IOException { 38 38 BufferedReader in = new BufferedReader(new InputStreamReader(new URL(url).openStream(), "utf-8")); 39 if (url.startsWith(baseurl) && !url.endsWith("?format=txt")) 40 return readFromTrac(in); 41 return readNormal(in); 39 try { 40 if (url.startsWith(baseurl) && !url.endsWith("?format=txt")) 41 return readFromTrac(in); 42 return readNormal(in); 43 } finally { 44 in.close(); 45 } 42 46 } 43 47 … … 57 61 private String readLang(URL url) throws IOException { 58 62 InputStream in = url.openStream(); 59 return readFromTrac(new BufferedReader(new InputStreamReader(in, "utf-8"))); 63 try { 64 return readFromTrac(new BufferedReader(new InputStreamReader(in, "utf-8"))); 65 } finally { 66 in.close(); 67 } 60 68 } 61 69
Note:
See TracChangeset
for help on using the changeset viewer.