Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (9 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

Location:
trunk/test/unit/org/openstreetmap/josm/data/projection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java

    r6881 r8510  
    2020        double maxErrLat = 0, maxErrLon = 0;
    2121        Ellipsoid ellips = Ellipsoid.WGS84;
    22         for (int num=0; num<1000; ++num) {
     22        for (int num = 0; num < 1000; ++num) {
    2323
    2424            double lat = r.nextDouble() * 180.0 - 90.0;
    2525            double lon = r.nextDouble() * 360.0 - 180.0;
    26             LatLon ll = new LatLon(lat,lon);
     26            LatLon ll = new LatLon(lat, lon);
    2727
    28             for (int i=0; i<1000; ++i) {
     28            for (int i = 0; i < 1000; ++i) {
    2929                double[] cart = ellips.latLon2Cart(ll);
    3030                ll = ellips.cart2LatLon(cart);
    3131
    32                 if (!(Math.abs(lat - ll.lat())<EPSILON && Math.abs(lon - ll.lon())<EPSILON)) {
     32                if (!(Math.abs(lat - ll.lat()) < EPSILON && Math.abs(lon - ll.lon()) < EPSILON)) {
    3333                    String error = String.format("point: %s iterations: %s current: %s errorLat: %s errorLon %s",
    3434                            new LatLon(lat, lon), i, ll, Math.abs(lat - ll.lat()), Math.abs(lon - ll.lon()));
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r8509 r8510  
    6565            prevData = readData();
    6666        }
    67         Map<String,TestData> prevCodesMap = new HashMap<>();
     67        Map<String, TestData> prevCodesMap = new HashMap<>();
    6868        for (TestData data : prevData) {
    6969            prevCodesMap.put(data.code, data);
     
    116116                TestData next = new TestData();
    117117
    118                 Pair<Double,Double> ll = readLine("ll", in.readLine());
    119                 Pair<Double,Double> en = readLine("en", in.readLine());
    120                 Pair<Double,Double> ll2 = readLine("ll2", in.readLine());
     118                Pair<Double, Double> ll = readLine("ll", in.readLine());
     119                Pair<Double, Double> en = readLine("en", in.readLine());
     120                Pair<Double, Double> ll2 = readLine("ll2", in.readLine());
    121121
    122122                next.code = line;
     
    131131    }
    132132
    133     private static Pair<Double,Double> readLine(String expectedName, String input) {
     133    private static Pair<Double, Double> readLine(String expectedName, String input) {
    134134        String[] fields = input.trim().split("[ ]+");
    135135        if (fields.length != 3) throw new AssertionError();
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java

    r6881 r8510  
    2828        }
    2929
    30         for (int i=0; i<=3; ++i) {
     30        for (int i = 0; i <= 3; ++i) {
    3131            testProj(Projections.getProjectionByCode("EPSG:"+Integer.toString(27561+i))); // Lambert 4 Zones France
    3232        }
    3333
    34         for (int i=0; i<=4; ++i) {
     34        for (int i = 0; i <= 4; ++i) {
    3535            testProj(Projections.getProjectionByCode("EPSG:"+Integer.toString(2176+i))); // PUWG Poland
    3636        }
     
    3838        testProj(Projections.getProjectionByCode("EPSG:21781")); // Swiss grid
    3939
    40         for (int i=0; i<=60; ++i) {
     40        for (int i = 0; i <= 60; ++i) {
    4141            testProj(Projections.getProjectionByCode("EPSG:"+Integer.toString(32601+i))); // UTM North
    4242            testProj(Projections.getProjectionByCode("EPSG:"+Integer.toString(32701+i))); // UTM South
     
    4444
    4545        if (!"yes".equals(System.getProperty("suppressPermanentFailure"))) {
    46             for (int i=0; i<=4; ++i) {
     46            for (int i = 0; i <= 4; ++i) {
    4747                testProj(Projections.getProjectionByCode("EPSG:"+Integer.toString(2969+i))); // UTM France DOM
    4848            }
    4949        }
    5050
    51         for (int i=0; i<=8; ++i) {
     51        for (int i = 0; i <= 8; ++i) {
    5252            testProj(Projections.getProjectionByCode("EPSG:"+Integer.toString(3942+i))); // Lambert CC9 Zones France
    5353        }
     
    6565
    6666            text += String.format("*** %s %s%n", p.toString(), p.toCode());
    67             for (int num=0; num < 1000; ++num) {
     67            for (int num = 0; num < 1000; ++num) {
    6868
    6969                double lat = rand.nextDouble() * (b.getMax().lat() - b.getMin().lat()) + b.getMin().lat();
     
    7272                LatLon ll = new LatLon(lat, lon);
    7373
    74                 for (int i=0; i<10; ++i) {
     74                for (int i = 0; i < 10; ++i) {
    7575                    EastNorth en = p.latlon2eastNorth(ll);
    7676                    ll = p.eastNorth2latlon(en);
  • trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java

    r8450 r8510  
    2828     */
    2929    ProjData[] data = {
    30             new ProjData("Zimmerwald",      d(7,27,54.983506), d(46,52,37.540562), 947.149, 602030.680, 191775.030, 897.915),
    31             new ProjData("Chrischona",      d(7,40,6.983077), d(47,34, 1.385301), 504.935,  617306.300, 268507.300, 456.064),
    32             new ProjData("Pfaender",        d(9,47,3.697723), d(47,30,55.172797), 1089.372, 776668.105, 265372.681, 1042.624),
    33             new ProjData("La Givrine",      d(6,6,7.326361), d(46,27,14.690021), 1258.274,  497313.292, 145625.438, 1207.434),
    34             new ProjData("Monte Generoso",  d(9,1,16.389053), d(45,55,45.438020), 1685.027, 722758.810, 87649.670, 1636.600) };
     30            new ProjData("Zimmerwald",      d(7, 27, 54.983506), d(46, 52, 37.540562), 947.149, 602030.680, 191775.030, 897.915),
     31            new ProjData("Chrischona",      d(7, 40, 6.983077), d(47, 34, 1.385301), 504.935,  617306.300, 268507.300, 456.064),
     32            new ProjData("Pfaender",        d(9, 47, 3.697723), d(47, 30, 55.172797), 1089.372, 776668.105, 265372.681, 1042.624),
     33            new ProjData("La Givrine",      d(6, 6, 7.326361), d(46, 27, 14.690021), 1258.274,  497313.292, 145625.438, 1207.434),
     34            new ProjData("Monte Generoso",  d(9, 1, 16.389053), d(45, 55, 45.438020), 1685.027, 722758.810, 87649.670, 1636.600) };
    3535
    3636    private double d(double deg, double min, double sec) {
     
    4242        public LatLon ll;
    4343        public EastNorth en;
     44
    4445        public ProjData(String name, double lon, double lat, double h1, double x, double y, double h2) {
    4546            this.name = name;
     
    128129    }
    129130
    130 
    131131    @Test
    132132    public void b_eastNorth2latlon_test() {
Note: See TracChangeset for help on using the changeset viewer.