Changeset 11042 in josm for trunk/src/org


Ignore:
Timestamp:
2016-09-22T23:08:23+02:00 (8 years ago)
Author:
simon04
Message:

Use CachedFile#getContentReader where possible

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r10469 r11042  
    44import java.io.BufferedReader;
    55import java.io.IOException;
    6 import java.io.InputStream;
    7 import java.io.InputStreamReader;
    8 import java.nio.charset.StandardCharsets;
    96import java.util.ArrayList;
    107import java.util.Collection;
     
    272269        try (
    273270            CachedFile cf = new CachedFile(path);
    274             InputStream in = cf.getInputStream();
    275             BufferedReader r = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
     271            BufferedReader r = cf.getContentReader()
    276272        ) {
    277273            return loadProjectionDefinitions(r);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java

    r10978 r11042  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.io.InputStreamReader;
    76import java.io.Reader;
    8 import java.nio.charset.StandardCharsets;
    97import java.util.ArrayList;
    108import java.util.Arrays;
     
    5452        if (ENGINE != null) {
    5553            try (CachedFile cf = new CachedFile("resource://data/validator/opening_hours.js");
    56                  Reader reader = new InputStreamReader(cf.getInputStream(), StandardCharsets.UTF_8)) {
     54                 Reader reader = cf.getContentReader()) {
    5755                ENGINE.eval(reader);
    5856                ENGINE.eval("var opening_hours = require('opening_hours');");
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r10632 r11042  
    99import java.io.BufferedReader;
    1010import java.io.IOException;
    11 import java.io.InputStream;
    1211import java.text.MessageFormat;
    1312import java.util.ArrayList;
     
    5352import org.openstreetmap.josm.gui.widgets.EditableList;
    5453import org.openstreetmap.josm.io.CachedFile;
    55 import org.openstreetmap.josm.io.UTFInputStreamReader;
    5654import org.openstreetmap.josm.tools.GBC;
    5755import org.openstreetmap.josm.tools.MultiMap;
     
    169167            try (
    170168                CachedFile cf = new CachedFile(source);
    171                 InputStream s = cf.getInputStream();
    172                 BufferedReader reader = new BufferedReader(UTFInputStreamReader.create(s));
     169                BufferedReader reader = cf.getContentReader()
    173170            ) {
    174171                String okValue = null;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r10927 r11042  
    66import java.io.File;
    77import java.io.IOException;
    8 import java.io.InputStreamReader;
    9 import java.nio.charset.StandardCharsets;
     8import java.io.Reader;
    109import java.util.ArrayList;
    1110import java.util.Arrays;
     
    314313            if (Utils.hasExtension(entry.url, "mapcss"))
    315314                return new MapCSSStyleSource(entry);
    316             try (InputStreamReader reader = new InputStreamReader(cf.getInputStream(), StandardCharsets.UTF_8)) {
     315            try (Reader reader = cf.getContentReader()) {
    317316                WHILE: while (true) {
    318317                    int c = reader.read();
Note: See TracChangeset for help on using the changeset viewer.