Ignore:
Timestamp:
2013-09-27T19:50:29+02:00 (11 years ago)
Author:
Don-vip
Message:

Sonar/FindBugs - Bad practice - Method may fail to close stream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r6245 r6268  
    328328        try {
    329329            c.close();
    330         } catch(IOException e) {
    331             // ignore
     330        } catch (IOException e) {
     331            Main.warn(e);
    332332        }
    333333    }
     
    342342        try {
    343343            zip.close();
    344         } catch(IOException e) {
    345             // ignore
    346         }
    347     }
    348 
    349     private final static double EPSILION = 1e-11;
    350 
     344        } catch (IOException e) {
     345            Main.warn(e);
     346        }
     347    }
     348
     349    private final static double EPSILON = 1e-11;
     350
     351    /**
     352     * Determines if the two given double values are equal (their delta being smaller than a fixed epsilon)
     353     * @param a The first double value to compare
     354     * @param b The second double value to compare
     355     * @return {@code true} if {@code abs(a - b) <= 1e-11}, {@code false} otherwise
     356     */
    351357    public static boolean equalsEpsilon(double a, double b) {
    352         return Math.abs(a - b) <= EPSILION;
     358        return Math.abs(a - b) <= EPSILON;
    353359    }
    354360
Note: See TracChangeset for help on using the changeset viewer.