Ignore:
Timestamp:
2013-12-28T00:30:15+01:00 (12 years ago)
Author:
simon04
Message:

Refactoring: introduce Utils.UTF_8 charset to avoid handling of UnsupportedEncodingException

According to the Javadoc of Charset, every implementation of the Java
platform is required to support UTF-8.

File:
1 edited

Legend:

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

    r6296 r6552  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins;
     3
     4import org.openstreetmap.josm.tools.Utils;
    35
    46import static org.openstreetmap.josm.tools.I18n.tr;
     
    911import java.io.InputStream;
    1012import java.io.InputStreamReader;
    11 import java.io.UnsupportedEncodingException;
    1213import java.util.LinkedList;
    1314import java.util.List;
     
    3536        try {
    3637            return new PluginInformation(
    37                     new ByteArrayInputStream(manifest.getBytes("utf-8")),
     38                    new ByteArrayInputStream(manifest.getBytes(Utils.UTF_8)),
    3839                    name.substring(0, name.length() - 4),
    3940                    url
    4041                    );
    41         } catch(UnsupportedEncodingException e) {
    42             throw new PluginListParseException(tr("Failed to create plugin information from manifest for plugin ''{0}''", name), e);
    4342        } catch (PluginException e) {
    4443            throw new PluginListParseException(tr("Failed to create plugin information from manifest for plugin ''{0}''", name), e);
     
    6160        BufferedReader r = null;
    6261        try {
    63             r = new BufferedReader(new InputStreamReader(in, "utf-8"));
     62            r = new BufferedReader(new InputStreamReader(in, Utils.UTF_8));
    6463            String name = null;
    6564            String url = null;
Note: See TracChangeset for help on using the changeset viewer.