Changeset 10060 in josm


Ignore:
Timestamp:
2016-03-27T19:26:23+02:00 (2 years ago)
Author:
Don-vip
Message:

see #11924 - remove deprecated code, reduce double precision in unit tests to avoid tiny differences with JDK9

Location:
trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r10033 r10060  
    458458
    459459    /**
    460      * Returns the value rounded to OSM precisions, i.e. to {@link LatLon#MAX_SERVER_PRECISION}.
     460     * Returns the value rounded to OSM precisions, i.e. to {@link #MAX_SERVER_PRECISION}.
    461461     * @param value lat/lon value
    462462     *
     
    468468
    469469    /**
    470      * Returns the value rounded to OSM precision. This function is now the same as
    471      * {@link #roundToOsmPrecision(double)}, since the rounding error has been fixed.
    472      * @param value lat/lon value
    473      *
    474      * @return rounded value
    475      * @deprecated Use {@link #roundToOsmPrecision(double)} instead
    476      */
    477     @Deprecated
    478     public static double roundToOsmPrecisionStrict(double value) {
    479         return roundToOsmPrecision(value);
    480     }
    481 
    482     /**
    483      * Replies a clone of this lat LatLon, rounded to OSM precisions, i.e. to
    484      * MAX_SERVER_PRECISION
     470     * Replies a clone of this lat LatLon, rounded to OSM precisions, i.e. to {@link #MAX_SERVER_PRECISION}
    485471     *
    486472     * @return a clone of this lat LatLon
     
    491477                roundToOsmPrecision(lon())
    492478                );
    493     }
    494 
    495     /**
    496      * Replies a clone of this lat LatLon, rounded to OSM precisions, i.e. to
    497      * MAX_SERVER_PRECISION
    498      *
    499      * @return a clone of this lat LatLon
    500      * @deprecated Use {@link #getRoundedToOsmPrecision()} instead
    501      */
    502     @Deprecated
    503     public LatLon getRoundedToOsmPrecisionStrict() {
    504         return getRoundedToOsmPrecision();
    505479    }
    506480
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r9078 r10060  
    173173        // Critical: only allow TLS ("serverAuth" = 1.3.6.1.5.5.7.3.1)
    174174        ext.set(ExtendedKeyUsageExtension.NAME, new ExtendedKeyUsageExtension(Boolean.TRUE,
    175                 new Vector<ObjectIdentifier>(Arrays.asList(new ObjectIdentifier("1.3.6.1.5.5.7.3.1")))));
     175                new Vector<>(Arrays.asList(new ObjectIdentifier("1.3.6.1.5.5.7.3.1")))));
    176176
    177177        if (san != null) {
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r9908 r10060  
    4444
    4545    private static final String PROJECTION_DATA_FILE = "data_nodist/projection/projection-regression-test-data";
    46     private static final String PROJECTION_DATA_FILE_JAVA_9 = "data_nodist/projection/projection-regression-test-data-java9";
    4746
    4847    private static class TestData {
     
    5150        public EastNorth en;
    5251        public LatLon ll2;
    53     }
    54 
    55     private static String getProjectionDataFile() {
    56         return TestUtils.getJavaVersion() >= 9 ? PROJECTION_DATA_FILE_JAVA_9 : PROJECTION_DATA_FILE;
    5752    }
    5853
     
    7166
    7267        List<TestData> prevData = new ArrayList<>();
    73         if (new File(getProjectionDataFile()).exists()) {
     68        if (new File(PROJECTION_DATA_FILE).exists()) {
    7469            prevData = readData();
    7570        }
     
    9388        Random rand = new Random();
    9489        try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
    95                 new FileOutputStream(getProjectionDataFile()), StandardCharsets.UTF_8))) {
     90                new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) {
    9691            out.write("# Data for test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java\n");
    9792            out.write("# Format: 1. Projection code; 2. lat/lon; 3. lat/lon projected -> east/north; 4. east/north (3.) inverse projected\n");
     
    118113
    119114    private static List<TestData> readData() throws IOException, FileNotFoundException {
    120         try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(getProjectionDataFile()),
     115        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE),
    121116                StandardCharsets.UTF_8))) {
    122117            List<TestData> result = new ArrayList<>();
     
    136131                next.en = new EastNorth(en.a, en.b);
    137132                next.ll2 = new LatLon(ll2.a, ll2.b);
     133                if (TestUtils.getJavaVersion() >= 9) {
     134                    next.ll = next.ll.getRoundedToOsmPrecision();
     135                    next.en = new EastNorth(LatLon.roundToOsmPrecision(en.a), LatLon.roundToOsmPrecision(en.b));
     136                    next.ll2 = next.ll2.getRoundedToOsmPrecision();
     137                }
    138138
    139139                result.add(next);
Note: See TracChangeset for help on using the changeset viewer.