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/io/CacheCustomContent.java

    r6102 r6552  
    88import java.io.FileOutputStream;
    99import java.io.IOException;
    10 import java.io.UnsupportedEncodingException;
    1110
    1211import org.openstreetmap.josm.Main;
     
    120119    public String updateForceString() throws T {
    121120        updateForce();
    122         try {
    123             return new String(data, "utf-8");
    124         } catch (UnsupportedEncodingException e){
    125             e.printStackTrace();
    126             return "";
    127         }
     121        return new String(data, Utils.UTF_8);
    128122    }
    129123
     
    144138     */
    145139    public String getDataString() throws T {
    146         try {
    147             return new String(getData(), "utf-8");
    148         } catch(UnsupportedEncodingException e){
    149             e.printStackTrace();
    150             return "";
    151         }
     140        return new String(getData(), Utils.UTF_8);
    152141    }
    153142
Note: See TracChangeset for help on using the changeset viewer.