Changeset 8393 in josm


Ignore:
Timestamp:
2015-05-18T22:57:22+02:00 (9 years ago)
Author:
Don-vip
Message:

see #11447 - partial revert of r8384

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

Legend:

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

    r8384 r8393  
    232232        // center. This method is ok as long as distances are short
    233233        // relative to the distance from the N or S poles.
    234         if (Double.doubleToRawLongBits(radius) == 0) {
     234        if (radius == 0) {
    235235            for (Node n : nodes) {
    236236                radius += distance(center, n.getEastNorth());
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r8384 r8393  
    363363            b = xM - xB;
    364364            double norm = Math.sqrt(a*a + b*b);
    365             if (Double.doubleToRawLongBits(norm) == 0)
     365            if (norm == 0)
    366366                // Nodes have same coordinates !
    367367                throw new InvalidSelection();
  • trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java

    r8384 r8393  
    6161                    EastNorth en2 = Main.map.mapView.getProjection().latlon2eastNorth(bBox.getBottomRight());
    6262                    double s = Math.abs((en1.east() - en2.east()) * (en1.north() - en2.north()));
    63                     if (Double.doubleToRawLongBits(s) == 0) {
    64                         s = 1e8;
    65                     }
     63                    if (s == 0) s = 1e8;
    6664                    found.put(s, r);
    6765                }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r8390 r8393  
    10051005            // In practice this will probably only happen when a way has been duplicated
    10061006
    1007             if (Double.doubleToRawLongBits(u) == 0)
     1007            if (u == 0)
    10081008                return;
    10091009
  • trunk/src/org/openstreetmap/josm/actions/mapmode/PlayHeadDragMode.java

    r8384 r8393  
    6060            dragging = true;
    6161        }
    62         if (Double.doubleToRawLongBits(p.distance(mousePos)) == 0) return;
     62        if (p.distance(mousePos) == 0) return;
    6363        playHeadMarker.drag(Main.map.mapView.getEastNorth(ev.getX(), ev.getY()));
    6464        mousePos = p;
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r8384 r8393  
    295295                        double C = -A * rx - B * ry;
    296296                        double RSsq = A * A + B * B;
    297                         if (Double.doubleToRawLongBits(RSsq) == 0) {
     297                        if (RSsq == 0) {
    298298                            continue;
    299299                        }
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r8390 r8393  
    948948    public String getToolbarName() {
    949949        String res = name;
    950         if (Double.doubleToRawLongBits(pixelPerDegree) != 0) {
     950        if (pixelPerDegree != 0) {
    951951            res += "#PPD="+pixelPerDegree;
    952952        }
     
    956956    public String getMenuName() {
    957957        String res = name;
    958         if (Double.doubleToRawLongBits(pixelPerDegree) != 0) {
     958        if (pixelPerDegree != 0) {
    959959            res += " ("+pixelPerDegree+")";
    960960        }
  • trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java

    r8384 r8393  
    7171        res.add(String.valueOf(dx));
    7272        res.add(String.valueOf(dy));
    73         if (Double.doubleToRawLongBits(centerX) != 0 || Double.doubleToRawLongBits(centerY) != 0) {
     73        if (centerX != 0 || centerY != 0) {
    7474            res.add(String.valueOf(centerX));
    7575            res.add(String.valueOf(centerY));
  • trunk/src/org/openstreetmap/josm/data/osm/BBox.java

    r8384 r8393  
    274274        if (o instanceof BBox) {
    275275            BBox b = (BBox)o;
    276             return Utils.equalsEpsilon(b.xmax, xmax) && Utils.equalsEpsilon(b.ymax, ymax)
    277                     && Utils.equalsEpsilon(b.xmin, xmin) && Utils.equalsEpsilon(b.ymin, ymin);
     276            return b.xmax == xmax && b.ymax == ymax
     277                    && b.xmin == xmin && b.ymin == ymin;
    278278        } else
    279279            return false;
  • trunk/src/org/openstreetmap/josm/data/osm/NodePositionComparator.java

    r8384 r8393  
    2626            return -1;
    2727        double dLon = n1.getCoor().lon() - n2.getCoor().lon();
    28         if (Double.doubleToRawLongBits(dLon) == 0)
     28        if (dLon == 0)
    2929            return 0;
    3030        return dLon > 0 ? 1 : -1;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r8384 r8393  
    142142            double lenNext = Math.sqrt(dxNext*dxNext + dyNext*dyNext);
    143143
    144             if (Double.doubleToRawLongBits(lenNext) == 0) {
     144            if (lenNext == 0) {
    145145                lenNext = 1; // value does not matter, because dy_next and dx_next is 0
    146146            }
     
    998998
    999999        double fromAngle;
    1000         if (Double.doubleToRawLongBits(dx) == 0) {
     1000        if (dx == 0) {
    10011001            fromAngle = Math.PI/2;
    10021002        } else {
     
    13151315                    if (showHeadArrowOnly ? !it.hasNext() : showOrientation) {
    13161316                        final double segmentLength = p1.distance(p2);
    1317                         if (Double.doubleToRawLongBits(segmentLength) != 0) {
     1317                        if (segmentLength != 0) {
    13181318                            final double l =  (10. + line.getLineWidth()) / segmentLength;
    13191319
     
    13281328                    if (showOneway) {
    13291329                        final double segmentLength = p1.distance(p2);
    1330                         if (Double.doubleToRawLongBits(segmentLength) != 0) {
     1330                        if (segmentLength != 0) {
    13311331                            final double nx = (p2.x - p1.x) / segmentLength;
    13321332                            final double ny = (p2.y - p1.y) / segmentLength;
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r8390 r8393  
    342342        boolean isCentric = true;
    343343        for (Double param : towgs84Param) {
    344             if (Double.doubleToRawLongBits(param) != 0) {
     344            if (param != 0) {
    345345                isCentric = false;
    346346                break;
     
    351351        boolean is3Param = true;
    352352        for (int i = 3; i<towgs84Param.size(); i++) {
    353             if (Double.doubleToRawLongBits(towgs84Param.get(i)) != 0) {
     353            if (towgs84Param.get(i) != 0) {
    354354                is3Param = false;
    355355                break;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r8384 r8393  
    5959                if (coor == null)
    6060                    return null;
    61                 if (Double.doubleToRawLongBits(precision) == 0)
     61                if (precision == 0)
    6262                    return coor.getRoundedToOsmPrecision();
    6363                return roundCoord(coor);
     
    6666                if (coor == null)
    6767                    return null;
    68                 if (Double.doubleToRawLongBits(precision) == 0)
     68                if (precision == 0)
    6969                    return coor.getRoundedToOsmPrecision();
    7070                return roundCoord(coor);
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r8387 r8393  
    296296    @Override
    297297    public void setBoundingBox(Bounds bbox) {
    298         if (bbox == null || (Double.doubleToRawLongBits(bbox.getMinLat()) == 0 && Double.doubleToRawLongBits(bbox.getMinLon()) == 0
    299                 && Double.doubleToRawLongBits(bbox.getMaxLat()) == 0 && Double.doubleToRawLongBits(bbox.getMaxLon()) == 0)) {
     298        if (bbox == null || (bbox.getMinLat() == 0 && bbox.getMinLon() == 0
     299                && bbox.getMaxLat() == 0 && bbox.getMaxLon() == 0)) {
    300300            this.bbox = null;
    301301            iSelectionRectStart = null;
  • trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java

    r8384 r8393  
    144144                panel.add(new UrlLabel(url), GBC.eol().insets(2, 5, 10, 0));
    145145            }
    146             if (Double.doubleToRawLongBits(dx) != 0 || Double.doubleToRawLongBits(dy) != 0) {
     146            if (dx != 0 || dy != 0) {
    147147                panel.add(new JLabel(tr("Offset: ") + dx + ";" + dy), GBC.eol().insets(0, 5, 10, 0));
    148148            }
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r8384 r8393  
    270270        boolean oldValue = isVisible();
    271271        this.visible  = visible;
    272         if (visible && Double.doubleToRawLongBits(opacity) == 0) {
     272        if (visible && opacity == 0) {
    273273            setOpacity(1);
    274274        } else if (oldValue != isVisible()) {
     
    282282     */
    283283    public boolean isVisible() {
    284         return visible && Double.doubleToRawLongBits(opacity) != 0;
     284        return visible && opacity != 0;
    285285    }
    286286
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r8390 r8393  
    419419        int screenPixels = mv.getWidth()*mv.getHeight();
    420420        double tilePixels = Math.abs((y2-y1)*(x2-x1)*tileSource.getTileSize()*tileSource.getTileSize());
    421         if (screenPixels == 0 || Double.doubleToRawLongBits(tilePixels) == 0) return 1;
     421        if (screenPixels == 0 || tilePixels == 0) return 1;
    422422        return screenPixels/tilePixels;
    423423    }
     
    12611261        EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight());
    12621262
    1263         if (Double.doubleToRawLongBits(botRight.east()) == 0 || Double.doubleToRawLongBits(botRight.north()) == 0) {
     1263        if (botRight.east() == 0 || botRight.north() == 0) {
    12641264            /*Main.debug("still initializing??");*/
    12651265            // probably still initializing
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r8384 r8393  
    907907                    // parse slider position into real timezone
    908908                    double tz = Math.abs(sldTimezone.getValue());
    909                     String zone = Double.doubleToRawLongBits(tz % 2) == 0
     909                    String zone = tz % 2 == 0
    910910                    ? (int)Math.floor(tz/2) + ":00"
    911911                            : (int)Math.floor(tz/2) + ":30";
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java

    r8390 r8393  
    149149            return !(s.isEmpty() || "false".equals(s) || "no".equals(s) || "0".equals(s) || "0.0".equals(s));
    150150        if (o instanceof Number)
    151             return Float.floatToRawIntBits(((Number) o).floatValue()) != 0;
     151            return ((Number) o).floatValue() != 0;
    152152        if (o instanceof List)
    153153            return !((List) o).isEmpty();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java

    r8384 r8393  
    1111import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
    1212import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.RelativeFloat;
    13 import org.openstreetmap.josm.tools.Utils;
    1413
    1514public abstract class ElemStyle implements StyleKeys {
     
    210209        ElemStyle s = (ElemStyle) o;
    211210        return isModifier == s.isModifier &&
    212                 Utils.equalsEpsilon(majorZIndex, s.majorZIndex) &&
    213                 Utils.equalsEpsilon(zIndex, s.zIndex) &&
    214                 Utils.equalsEpsilon(objectZIndex, s.objectZIndex);
     211                majorZIndex == s.majorZIndex &&
     212                zIndex == s.zIndex &&
     213                objectZIndex == s.objectZIndex;
    215214    }
    216215
  • trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java

    r8384 r8393  
    335335            Objects.equals(dashesLine, other.dashesLine) &&
    336336            Objects.equals(dashesBackground, other.dashesBackground) &&
    337             Utils.equalsEpsilon(offset, other.offset) &&
    338             Utils.equalsEpsilon(realWidth, other.realWidth);
     337            offset == other.offset &&
     338            realWidth == other.realWidth;
    339339    }
    340340
     
    356356            " realWidth=" + realWidth + " color=" + Utils.toString(color) +
    357357            " dashed=" + Arrays.toString(line.getDashArray()) +
    358             (Float.floatToRawIntBits(line.getDashPhase()) == 0 ? "" : " dashesOffses=" + line.getDashPhase()) +
     358            (line.getDashPhase() == 0 ? "" : " dashesOffses=" + line.getDashPhase()) +
    359359            " dashedColor=" + Utils.toString(dashesBackground) +
    360360            " linejoin=" + linejoinToString(line.getLineJoin()) +
    361361            " linecap=" + linecapToString(line.getEndCap()) +
    362             (Float.floatToRawIntBits(offset) == 0 ? "" : " offset=" + offset) +
     362            (offset == 0 ? "" : " offset=" + offset) +
    363363            '}';
    364364    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/RepeatImageElemStyle.java

    r8384 r8393  
    77import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
    88import org.openstreetmap.josm.tools.CheckParameterUtil;
    9 import org.openstreetmap.josm.tools.Utils;
    109
    1110public class RepeatImageElemStyle extends ElemStyle implements StyleKeys {
     
    7069        final RepeatImageElemStyle other = (RepeatImageElemStyle) obj;
    7170        if (!this.pattern.equals(other.pattern)) return false;
    72         if (!Utils.equalsEpsilon(this.offset, other.offset)) return false;
    73         if (!Utils.equalsEpsilon(this.spacing, other.spacing)) return false;
    74         if (!Utils.equalsEpsilon(this.phase, other.phase)) return false;
     71        if (this.offset != other.offset) return false;
     72        if (this.spacing != other.spacing) return false;
     73        if (this.phase != other.phase) return false;
    7574        if (this.align != other.align) return false;
    7675        return true;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r8390 r8393  
    177177            float res = args[0];
    178178            for (int i = 1; i < args.length; ++i) {
    179                 if (Float.floatToRawIntBits(args[i]) == 0) {
     179                if (args[i] == 0) {
    180180                    return null;
    181181                }
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r8384 r8393  
    277277                            if (playingUrl != command.url() ||
    278278                                    stateChange != State.PAUSED ||
    279                                     Double.doubleToRawLongBits(offset) != 0)
     279                                    offset != 0)
    280280                            {
    281281                                if (audioInputStream != null) {
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r8387 r8393  
    352352        // Solve the equations
    353353        double det = a1 * b2 - a2 * b1;
    354         if (Double.doubleToRawLongBits(det) == 0)
     354        if (det == 0)
    355355            return null; // Lines are parallel
    356356
     
    388388
    389389        //segment zero length
    390         if (Double.doubleToRawLongBits(ldx) == 0 && Double.doubleToRawLongBits(ldy) == 0)
     390        if (ldx == 0 && ldy == 0)
    391391            return p1;
    392392
     
    828828            b[i] = pt1.north() - pt2.north();
    829829            double d = Math.sqrt(a[i]*a[i] + b[i]*b[i]);
    830             if (Double.doubleToRawLongBits(d) == 0) return null;
     830            if(d == 0) return null;
    831831            a[i] /= d;
    832832            b[i] /= d;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r8384 r8393  
    11801180        // convert rotatedAngle to an integer value from 0 to 360
    11811181        Long originalAngle = Math.round(rotatedAngle % 360);
    1182         if (Double.doubleToRawLongBits(rotatedAngle) != 0 && originalAngle == 0) {
     1182        if (rotatedAngle != 0 && originalAngle == 0) {
    11831183            originalAngle = 360L;
    11841184        }
     
    11971197                // convert originalAngle to a value from 0 to 90
    11981198                double angle = originalAngle % 90;
    1199                 if (originalAngle != 0 && Double.doubleToRawLongBits(angle) == 0) {
     1199                if (originalAngle != 0 && angle == 0) {
    12001200                    angle = 90.0;
    12011201                }
Note: See TracChangeset for help on using the changeset viewer.