Changeset 11100 in josm


Ignore:
Timestamp:
2016-10-08T03:02:51+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - squid:S2148 - Underscores should be used to make large numbers readable

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r11045 r11100  
    198198            int zoomLvl = 18;
    199199            if (m > 0)
    200                 zoomLvl = (int) Math.round((-1) * Math.log(m/10000000)/Math.log(2));
     200                zoomLvl = (int) Math.round((-1) * Math.log(m/10_000_000)/Math.log(2));
    201201
    202202            url.setText(OsmUrlToBounds.getURL(dlat, dlon, zoomLvl));
  • trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java

    r10600 r11100  
    4242     * @since 3406
    4343     */
    44     public static final SystemOfMeasurement METRIC = new SystemOfMeasurement(1, "m", 1000, "km", "km/h", 3.6, 10000, "ha");
     44    public static final SystemOfMeasurement METRIC = new SystemOfMeasurement(1, "m", 1000, "km", "km/h", 3.6, 10_000, "ha");
    4545
    4646    /**
  • trunk/src/org/openstreetmap/josm/data/osm/Storage.java

    r10655 r11100  
    275275     */
    276276    private static int rehash(int h) {
    277         return (1103515245*h) >> 2;
     277        return (1_103_515_245*h) >> 2;
    278278    }
    279279
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java

    r11090 r11100  
    9595        showHeadArrowOnly = Main.pref.getBoolean("draw.segment.head_only", false);
    9696
    97         showNamesDistance = Main.pref.getInteger("mappaint.shownames", 10000000);
    98         useStrokesDistance = Main.pref.getInteger("mappaint.strokes", 10000000);
    99         showIconsDistance = Main.pref.getInteger("mappaint.showicons", 10000000);
     97        showNamesDistance = Main.pref.getInteger("mappaint.shownames", 10_000_000);
     98        useStrokesDistance = Main.pref.getInteger("mappaint.strokes", 10_000_000);
     99        showIconsDistance = Main.pref.getInteger("mappaint.showicons", 10_000_000);
    100100
    101101        selectedNodeSize = Main.pref.getInteger("mappaint.node.selected-size", 5);
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r11087 r11100  
    18141814        private final int directExecutionTaskSize;
    18151815
    1816         private final boolean drawArea = circum <= Main.pref.getInteger("mappaint.fillareas", 10000000);
     1816        private final boolean drawArea = circum <= Main.pref.getInteger("mappaint.fillareas", 10_000_000);
    18171817        private final boolean drawMultipolygon = drawArea && Main.pref.getBoolean("mappaint.multipolygon", true);
    18181818        private final boolean drawRestriction = Main.pref.getBoolean("mappaint.restriction", true);
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r10871 r11100  
    265265                this.lon0 = 6d * zone - 183d;
    266266                this.k0 = 0.9996;
    267                 this.x0 = 500000;
    268                 this.y0 = parameters.containsKey(Param.south.key) ? 10000000 : 0;
     267                this.x0 = 500_000;
     268                this.y0 = parameters.containsKey(Param.south.key) ? 10_000_000 : 0;
    269269            }
    270270            String s = parameters.get(Param.x_0.key);
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Util.java

    r10308 r11100  
    9898            j = getIntLE(b, 0);
    9999        }
    100         long l = ((long) i << 32) | (j & 0x00000000FFFFFFFFL);
     100        long l = ((long) i << 32) | (j & 0x0000_0000_FFFF_FFFFL);
    101101        return Double.longBitsToDouble(l);
    102102    }
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r11096 r11100  
    293293        String code = Main.getProjection().toCode();
    294294        if (Arrays.asList(ProjectionPreference.wgs84.allCodes()).contains(code)) {
    295             OsmValidator.griddetail = 10000;
     295            OsmValidator.griddetail = 10_000;
    296296        } else if (Arrays.asList(ProjectionPreference.mercator.allCodes()).contains(code)) {
    297297            OsmValidator.griddetail = 0.01;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/LongSegment.java

    r10378 r11100  
    5050    public void startTest(ProgressMonitor monitor) {
    5151        super.startTest(monitor);
    52         maxlength = Main.pref.getInteger("validator.maximum.segment.length", 15000);
     52        maxlength = Main.pref.getInteger("validator.maximum.segment.length", 15_000);
    5353    }
    5454
  • trunk/src/org/openstreetmap/josm/gui/Notification.java

    r10893 r11100  
    5353     * Somewhat longer message (10 s).
    5454     */
    55     public static final int TIME_LONG = Main.pref.getInteger("notification-time-long-ms", 10000);
     55    public static final int TIME_LONG = Main.pref.getInteger("notification-time-long-ms", 10_000);
    5656
    5757    /**
     
    5959     * (Make sure is still sensible to show as a notification)
    6060     */
    61     public static final int TIME_VERY_LONG = Main.pref.getInteger("notification-time-very_long-ms", 20000);
     61    public static final int TIME_VERY_LONG = Main.pref.getInteger("notification-time-very_long-ms", 20_000);
    6262
    6363    private Component content;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r10716 r11100  
    657657         */
    658658        public synchronized void sort() {
    659             if (selection.size() <= Main.pref.getInteger("selection.no_sort_above", 100000)) {
    660                 boolean quick = selection.size() > Main.pref.getInteger("selection.fast_sort_above", 10000);
     659            if (selection.size() <= Main.pref.getInteger("selection.no_sort_above", 100_000)) {
     660                boolean quick = selection.size() > Main.pref.getInteger("selection.fast_sort_above", 10_000);
    661661                selection.sort(new OsmPrimitiveComparator(quick, false));
    662662            }
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java

    r10234 r11100  
    117117                OutputStream out = new FileOutputStream(file)
    118118            ) {
    119                 byte[] buffer = new byte[32768];
     119                byte[] buffer = new byte[32_768];
    120120                int count = 0;
    121121                long p1 = 0;
  • trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java

    r10634 r11100  
    3737    }
    3838
    39     public static final int PROGRESS_BAR_MAX = 10000;
     39    public static final int PROGRESS_BAR_MAX = 10_000;
    4040    private final Component dialogParent;
    4141
  • trunk/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java

    r10600 r11100  
    3838
    3939    /** Ticks count used, when no other value is supplied */
    40     int DEFAULT_TICKS = 10000;
     40    int DEFAULT_TICKS = 10_000;
    4141
    4242    /**
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r10874 r11100  
    482482     */
    483483    public static void extendTooltipDelay(Component c) {
    484         extendTooltipDelay(c, 60000);
     484        extendTooltipDelay(c, 60_000);
    485485    }
    486486
  • trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java

    r10632 r11100  
    207207        CheckParameterUtil.ensureThat(noteLimit > 0, "Requested note limit is less than 1.");
    208208        // see result_limit in https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/notes_controller.rb
    209         CheckParameterUtil.ensureThat(noteLimit <= 10000, "Requested note limit is over API hard limit of 10000.");
     209        CheckParameterUtil.ensureThat(noteLimit <= 10_000, "Requested note limit is over API hard limit of 10000.");
    210210        CheckParameterUtil.ensureThat(daysClosed >= -1, "Requested note limit is less than -1.");
    211211        String url = "notes?limit=" + noteLimit + "&closed=" + daysClosed + "&bbox=" + lon1 + ',' + lat1 + ',' + lon2 + ',' + lat2;
  • trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java

    r10378 r11100  
    9797            return 0;
    9898        }
    99         if (port <= 0 || port > 65535) {
     99        if (port <= 0 || port > 65_535) {
    100100            Main.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));
    101101            Main.error(tr("The proxy will not be used."));
  • trunk/src/org/openstreetmap/josm/io/NoteReader.java

    r10378 r11100  
    7878            case "osm-notes":
    7979                parseMode = NoteParseMode.DUMP;
    80                 notes = new ArrayList<>(10000);
     80                notes = new ArrayList<>(10_000);
    8181                return;
    8282            }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r11096 r11100  
    140140        X509CertInfo info = new X509CertInfo();
    141141        Date from = new Date();
    142         Date to = new Date(from.getTime() + days * 86400000L);
     142        Date to = new Date(from.getTime() + days * 86_400_000L);
    143143        CertificateValidity interval = new CertificateValidity(from, to);
    144144        BigInteger sn = new BigInteger(64, new SecureRandom());
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r10662 r11100  
    312312                                bytesPerSecond = audioFormat.getFrameRate() /* frames per second */
    313313                                * audioFormat.getFrameSize() /* bytes per frame */;
    314                                 if (speed * bytesPerSecond > 256000.0) {
    315                                     speed = 256000 / bytesPerSecond;
     314                                if (speed * bytesPerSecond > 256_000.0) {
     315                                    speed = 256_000 / bytesPerSecond;
    316316                                }
    317317                                if (calibratedOffset > 0.0) {
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r11056 r11100  
    8080
    8181    private static final int MILLIS_OF_SECOND = 1000;
    82     private static final int MILLIS_OF_MINUTE = 60000;
    83     private static final int MILLIS_OF_HOUR = 3600000;
    84     private static final int MILLIS_OF_DAY = 86400000;
     82    private static final int MILLIS_OF_MINUTE = 60_000;
     83    private static final int MILLIS_OF_HOUR = 3_600_000;
     84    private static final int MILLIS_OF_DAY = 86_400_000;
    8585
    8686    /**
Note: See TracChangeset for help on using the changeset viewer.