Changeset 14746 in josm for trunk/src/org
- Timestamp:
- 2019-01-27T22:26:35+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r14745 r14746 20 20 import java.io.InputStream; 21 21 import java.io.InputStreamReader; 22 import java.nio.charset.StandardCharsets; 22 23 import java.util.Map.Entry; 23 24 … … 236 237 displayErrorMessage(ta, tr("Failed to locate resource ''{0}''.", filePath)); 237 238 } else { 238 try (InputStreamReader reader = new InputStreamReader(is, "UTF-8"); 239 BufferedReader br = new BufferedReader(reader)) { 239 try (BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { 240 240 String line; 241 241 while ((line = br.readLine()) != null) { -
trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java
r12620 r14746 6 6 import java.net.MalformedURLException; 7 7 import java.net.URL; 8 import java.nio.charset.StandardCharsets; 8 9 import java.util.List; 9 10 import java.util.concurrent.Callable; … … 58 59 final String r = HttpClient.create(u).connect().fetchContent(); 59 60 Logging.info("Successfully loaded Bing attribution data."); 60 return r.getBytes( "UTF-8");61 return r.getBytes(StandardCharsets.UTF_8); 61 62 } 62 63 -
trunk/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java
r13852 r14746 10 10 import java.io.FileFilter; 11 11 import java.io.IOException; 12 import java.io.PrintStream;13 12 import java.lang.management.ManagementFactory; 14 13 import java.nio.charset.StandardCharsets; … … 16 15 import java.nio.file.Path; 17 16 import java.util.ArrayList; 17 import java.util.Collections; 18 18 import java.util.Date; 19 19 import java.util.Deque; … … 223 223 private static void createNewPidFile(File autosaveDir, String filename) { 224 224 File pidFile = new File(autosaveDir, filename+".pid"); 225 try (PrintStream ps = new PrintStream(pidFile, "UTF-8")) { 226 ps.println(ManagementFactory.getRuntimeMXBean().getName()); 225 try { 226 final String content = ManagementFactory.getRuntimeMXBean().getName(); 227 Files.write(pidFile.toPath(), Collections.singleton(content), StandardCharsets.UTF_8); 227 228 } catch (IOException | SecurityException t) { 228 229 Logging.error(t); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r14489 r14746 89 89 * @param initState initial state 90 90 */ 91 @Deprecated 91 92 public MapCSSParser(InputStream in, String encoding, LexicalState initState) { 92 93 this(createTokenManager(in, encoding, initState)); … … 94 95 } 95 96 97 @Deprecated 96 98 protected static MapCSSParserTokenManager createTokenManager(InputStream in, String encoding, LexicalState initState) { 97 99 SimpleCharStream scs; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r14474 r14746 5 5 6 6 import java.awt.Color; 7 import java.io.BufferedReader; 7 8 import java.io.ByteArrayInputStream; 8 9 import java.io.File; 9 10 import java.io.IOException; 10 11 import java.io.InputStream; 12 import java.io.Reader; 13 import java.io.StringReader; 11 14 import java.lang.reflect.Field; 12 15 import java.nio.charset.StandardCharsets; … … 62 65 import org.openstreetmap.josm.gui.mappaint.styleelement.LineElement; 63 66 import org.openstreetmap.josm.io.CachedFile; 67 import org.openstreetmap.josm.io.UTFInputStreamReader; 64 68 import org.openstreetmap.josm.tools.CheckParameterUtil; 65 69 import org.openstreetmap.josm.tools.I18n; … … 426 430 canvasRules.clear(); 427 431 try (InputStream in = getSourceInputStream()) { 428 try {432 try (Reader reader = new BufferedReader(UTFInputStreamReader.create(in))) { 429 433 // evaluate @media { ... } blocks 430 MapCSSParser preprocessor = new MapCSSParser( in, "UTF-8", MapCSSParser.LexicalState.PREPROCESSOR);434 MapCSSParser preprocessor = new MapCSSParser(reader, MapCSSParser.LexicalState.PREPROCESSOR); 431 435 String mapcss = preprocessor.pp_root(this); 432 436 433 437 // do the actual mapcss parsing 434 InputStream in2 = new ByteArrayInputStream(mapcss.getBytes(StandardCharsets.UTF_8));435 MapCSSParser parser = new MapCSSParser(in2, "UTF-8",MapCSSParser.LexicalState.DEFAULT);438 Reader in2 = new StringReader(mapcss); 439 MapCSSParser parser = new MapCSSParser(in2, MapCSSParser.LexicalState.DEFAULT); 436 440 parser.sheet(this); 437 441 -
trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportSender.java
r14273 r14746 5 5 import java.io.InputStream; 6 6 import java.net.URL; 7 import java.net.URLEncoder;8 7 import java.nio.charset.StandardCharsets; 9 8 import java.util.Base64; … … 116 115 String text = Utils.strip(statusText); 117 116 String pdata = Base64.getEncoder().encodeToString(text.getBytes(StandardCharsets.UTF_8)); 118 String postQuery = "pdata=" + U RLEncoder.encode(pdata, "UTF-8");117 String postQuery = "pdata=" + Utils.encodeUrl(pdata); 119 118 HttpClient client = HttpClient.create(new URL(getJOSMTicketURL()), "POST") 120 119 .setHeader("Content-Type", "application/x-www-form-urlencoded")
Note:
See TracChangeset
for help on using the changeset viewer.