Changeset 8073 in josm for trunk/src/org


Ignore:
Timestamp:
2015-02-16T09:48:03+01:00 (10 years ago)
Author:
Don-vip
Message:

fix some Sonar issues

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java

    r7621 r8073  
    153153            case LEFT_CASING:
    154154            case RIGHT_CASING:
    155             {
    156155                Float baseWidthOnDefault = getWidth(c_def, WIDTH, null);
    157156                Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault);
     
    167166                offset += casingOffset;
    168167                break;
    169             }
    170168        }
    171169
     
    374372        }
    375373    }
     374
    376375    public String linecapToString(int linecap) {
    377376        switch (linecap) {
  • trunk/src/org/openstreetmap/josm/io/CachedFile.java

    r7890 r8073  
    257257    }
    258258
    259     @SuppressWarnings("resource")
    260259    private Pair<String, InputStream> findZipEntryImpl(String extension, String namepart) {
    261260        File file = null;
     
    263262            file = getFile();
    264263        } catch (IOException ex) {
     264            Main.warn(ex, false);
    265265        }
    266266        if (file == null)
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r8061 r8073  
    3737
    3838import org.openstreetmap.josm.Main;
     39import org.openstreetmap.josm.data.Preferences.pref;
     40import org.openstreetmap.josm.data.Preferences.writeExplicitly;
    3941import org.openstreetmap.josm.gui.ExtendedDialog;
    4042import org.openstreetmap.josm.gui.util.GuiHelper;
    41 import org.openstreetmap.josm.data.Preferences.pref;
    42 import org.openstreetmap.josm.data.Preferences.writeExplicitly;
    4343
    4444/**
     
    5757    public static class FontEntry {
    5858        /**
    59          * The character subset. Basically a free identifier, but should
    60          * be unique.
     59         * The character subset. Basically a free identifier, but should be unique.
    6160         */
    6261        @pref
    6362        public String charset;
     63
    6464        /**
    6565         * Platform font name.
     
    6767        @pref @writeExplicitly
    6868        public String name = "";
     69
    6970        /**
    7071         * File name.
     
    7374        public String file = "";
    7475
     76        /**
     77         * Constructs a new {@code FontEntry}.
     78         */
    7579        public FontEntry() {
    7680        }
    7781
     82        /**
     83         * Constructs a new {@code FontEntry}.
     84         * @param charset The character subset. Basically a free identifier, but should be unique
     85         * @param name Platform font name
     86         * @param file File name
     87         */
    7888        public FontEntry(String charset, String name, String file) {
    7989            this.charset = charset;
     
    448458     * configuration. Finally the system property "sun.awt.fontconfig" is set
    449459     * to the customized fontconfig.properties file.
    450      * 
     460     *
    451461     * This is a crude hack, but better than no font display at all for these
    452462     * languages.
     
    482492            OutputStream os = Files.newOutputStream(fontconfigFile);
    483493            os.write(content);
    484             try (Writer w = new BufferedWriter(new OutputStreamWriter(os))) {
     494            try (Writer w = new BufferedWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8))) {
    485495                Collection<FontEntry> extrasPref = Main.pref.getListOfStructs(
    486496                        "font.extended-unicode.extra-items", getAdditionalFonts(), FontEntry.class);
Note: See TracChangeset for help on using the changeset viewer.