Ignore:
Timestamp:
2014-05-09T05:32:37+02:00 (7 years ago)
Author:
Don-vip
Message:

see #8465 - replace Utils.UTF_8 by StandardCharsets.UTF_8, new in Java 7

Location:
trunk/src/org/openstreetmap/josm/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java

    r7005 r7082  
    99import java.io.InputStream;
    1010import java.io.InputStreamReader;
     11import java.nio.charset.StandardCharsets;
    1112import java.util.LinkedList;
    1213import java.util.List;
    1314
    1415import org.openstreetmap.josm.Main;
    15 import org.openstreetmap.josm.tools.Utils;
    1616
    1717/**
     
    3737        try {
    3838            return new PluginInformation(
    39                     new ByteArrayInputStream(manifest.getBytes(Utils.UTF_8)),
     39                    new ByteArrayInputStream(manifest.getBytes(StandardCharsets.UTF_8)),
    4040                    name.substring(0, name.length() - 4),
    4141                    url
     
    6161        BufferedReader r = null;
    6262        try {
    63             r = new BufferedReader(new InputStreamReader(in, Utils.UTF_8));
     63            r = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
    6464            String name = null;
    6565            String url = null;
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r7037 r7082  
    2020import java.net.MalformedURLException;
    2121import java.net.URL;
     22import java.nio.charset.StandardCharsets;
    2223import java.util.ArrayList;
    2324import java.util.Arrays;
     
    172173                connection.setRequestProperty("Accept-Charset", "utf-8");
    173174            }
    174             try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), Utils.UTF_8))) {
     175            try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
    175176                StringBuilder sb = new StringBuilder();
    176177                String line;
     
    204205        try (InputStream errStream = connection.getErrorStream()) {
    205206            if (errStream != null) {
    206                 try (BufferedReader err = new BufferedReader(new InputStreamReader(errStream, Utils.UTF_8))) {
     207                try (BufferedReader err = new BufferedReader(new InputStreamReader(errStream, StandardCharsets.UTF_8))) {
    207208                    String line;
    208209                    while ((line = err.readLine()) != null) {
     
    323324        File cacheFile = createSiteCacheFile(pluginDir, site, CacheType.PLUGIN_LIST);
    324325        getProgressMonitor().subTask(tr("Writing plugin list to local cache ''{0}''", cacheFile.toString()));
    325         try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(cacheFile), Utils.UTF_8))) {
     326        try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(cacheFile), StandardCharsets.UTF_8))) {
    326327            writer.write(list);
    327328            writer.flush();
     
    363364        try {
    364365            getProgressMonitor().subTask(tr("Parsing plugin list from site ''{0}''", site));
    365             InputStream in = new ByteArrayInputStream(doc.getBytes(Utils.UTF_8));
     366            InputStream in = new ByteArrayInputStream(doc.getBytes(StandardCharsets.UTF_8));
    366367            List<PluginInformation> pis = new PluginListParser().parse(in);
    367368            availablePlugins.addAll(filterDeprecatedPlugins(pis));
Note: See TracChangeset for help on using the changeset viewer.