Changeset 8395 in josm


Ignore:
Timestamp:
2015-05-19T00:05:33+02:00 (9 years ago)
Author:
Don-vip
Message:

convention - An open curly brace should be located at the end of a line

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

Legend:

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

    r8356 r8395  
    10001000                }
    10011001            }
    1002             if(!fileList.isEmpty())
    1003             {
     1002            if(!fileList.isEmpty()) {
    10041003                OpenFileAction.openFiles(fileList, true);
    10051004            }
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r8390 r8395  
    222222        final Way selectedWay = combineResult.a;
    223223        Main.main.undoRedo.add(combineResult.b);
    224         if(selectedWay != null)
    225         {
     224        if(selectedWay != null) {
    226225            Runnable guiTask = new Runnable() {
    227226                @Override
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r8384 r8395  
    13281328            }
    13291329
    1330             for (Way way :innerWays)
    1331             {
     1330            for (Way way :innerWays) {
    13321331                if (processedOuterWays.contains(way)) {
    13331332                    new Notification(
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r8390 r8395  
    11441144     * @param seg the reference segment
    11451145     */
    1146     private void drawReferenceSegment(Graphics2D g2, MapView mv, ReferenceSegment seg)
    1147     {
     1146    private void drawReferenceSegment(Graphics2D g2, MapView mv, ReferenceSegment seg) {
    11481147        Point p1 = mv.getPoint(seg.p1);
    11491148        Point p2 = mv.getPoint(seg.p2);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r8345 r8395  
    509509            return;
    510510
    511         if (mode != Mode.ROTATE && mode != Mode.SCALE) // button is pressed in rotate mode
    512         {
    513             if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0)
    514                 return;
     511        if (mode != Mode.ROTATE && mode != Mode.SCALE && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0) {
     512            // button is pressed in rotate mode
     513            return;
    515514        }
    516515
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r8394 r8395  
    261261        left.add(in_selection, GBC.eop());
    262262        left.add(caseSensitive, GBC.eol());
    263         if(Main.pref.getBoolean("expert", false))
    264         {
     263        if(Main.pref.getBoolean("expert", false)) {
    265264            left.add(allElements, GBC.eol());
    266265            left.add(regexSearch, GBC.eol());
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r8394 r8395  
    655655        private void processIfElement(Element elem) {
    656656            String realValue = evalVars(elem.getAttribute("test"));
    657             boolean v=false;
    658             if ("true".equals(realValue)) v=true; else
    659             if ("fales".equals(realValue)) v=true; else
    660             {
     657            boolean v = false;
     658            if ("true".equals(realValue) || "false".equals(realValue)) {
     659                processXmlFragment(elem);
     660                v = true;
     661            } else {
    661662                log("Error: Illegal test expression in if: %s=%s\n", elem.getAttribute("test"), realValue);
    662663            }
    663664
    664             if (v) processXmlFragment(elem);
    665665            lastV = v;
    666666        }
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r8394 r8395  
    17281728                    List<Map<String, String>> newlist = new ArrayList<Map<String, String>>();
    17291729                    boolean modified = false;
    1730                     for(Map<String, String> map : data)
    1731                     {
     1730                    for(Map<String, String> map : data) {
    17321731                         Map<String, String> newmap = new LinkedHashMap<String, String>();
    17331732                         for (Entry<String, String> entry : map.entrySet()) {
  • trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java

    r8384 r8395  
    5353        long tile = 0;
    5454        int i;
    55         for (i = NR_LEVELS-1; i >= 0; i--)
    56         {
     55        for (i = NR_LEVELS-1; i >= 0; i--) {
    5756            long xbit = (x >> i) & 1;
    5857            long ybit = (y >> i) & 1;
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r8390 r8395  
    298298       get/set functions calling this implicitely is preferred, so we can have
    299299       transparent cache handling in the future. */
    300     public void clearCachedStyle()
    301     {
     300    public void clearCachedStyle() {
    302301        mappaintStyle = null;
    303302    }
  • trunk/src/org/openstreetmap/josm/data/osm/User.java

    r8342 r8395  
    4949     */
    5050    public static synchronized User createLocalUser(String name) {
    51         for(long i = -1; i >= uidCounter; --i)
    52         {
     51        for(long i = -1; i >= uidCounter; --i) {
    5352            User olduser = getById(i);
    5453            if(olduser != null && olduser.hasName(name))
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java

    r7816 r8395  
    4949
    5050    public void visit(Bounds b) {
    51         if(b != null)
    52         {
     51        if (b != null) {
    5352            visit(b.getMin());
    5453            visit(b.getMax());
     
    5756
    5857    public void visit(ProjectionBounds b) {
    59         if(b != null)
    60         {
     58        if (b != null) {
    6159            visit(b.getMin());
    6260            visit(b.getMax());
     
    6563
    6664    public void visit(LatLon latlon) {
    67         if(latlon != null)
    68         {
    69             if(latlon instanceof CachedLatLon) {
     65        if (latlon != null) {
     66            if (latlon instanceof CachedLatLon) {
    7067                visit(((CachedLatLon)latlon).getEastNorth());
    7168            } else {
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java

    r8345 r8395  
    212212        if (it.hasNext()) {
    213213            Point lastP = nc.getPoint(it.next());
    214             while (it.hasNext())
    215             {
     214            while (it.hasNext()) {
    216215                Point p = nc.getPoint(it.next());
    217                 if (isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace))
    218                 {
     216                if (isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) {
    219217                    int x = (p.x+lastP.x)/2;
    220218                    int y = (p.y+lastP.y)/2;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r8393 r8395  
    750750        g.rotate(-theta, p.x, p.y);
    751751        g.setPaintMode();
    752         if (selected || member)
    753         {
     752        if (selected || member) {
    754753            Color color;
    755754            if (disabled) {
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java

    r8378 r8395  
    200200
    201201        for (final OsmPrimitive osm: data.searchNodes(bbox)) {
    202             if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden())
    203             {
     202            if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden()) {
    204203                osm.accept(this);
    205204            }
  • trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java

    r8126 r8395  
    382382                        }
    383383                    } else { // escaped value content is an entity name
    384                         if(mapNameToValue == null)
    385                         {
     384                        if(mapNameToValue == null) {
    386385                            mapNameToValue = new HashMap<>();
    387386                            for (String[] pair : ARRAY)
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r8394 r8395  
    155155                    n = node.getName();
    156156                }
    157                 if(n == null)
    158                 {
     157                if (n == null) {
    159158                    String s;
    160159                    if((s = node.get("addr:housename")) != null) {
     
    432431            if (OsmUtils.isTrue(building)) {
    433432                name = tr("building");
    434             } else if(building != null)
    435             {
     433            } else if (building != null) {
    436434                name = tr(building); // translate tag!
    437435            }
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r8390 r8395  
    652652        path.moveTo(p.x, p.y);
    653653        double max = b.getMax().lat();
    654         for(; lat <= max; lat += 1.0)
    655         {
     654        for(; lat <= max; lat += 1.0) {
    656655            p = getPoint(new LatLon(lat >= max ? max : lat, lon));
    657656            path.lineTo(p.x, p.y);
    658657        }
    659658        lat = max; max = b.getMax().lon();
    660         for(; lon <= max; lon += 1.0)
    661         {
     659        for(; lon <= max; lon += 1.0) {
    662660            p = getPoint(new LatLon(lat, lon >= max ? max : lon));
    663661            path.lineTo(p.x, p.y);
    664662        }
    665663        lon = max; max = b.getMinLat();
    666         for(; lat >= max; lat -= 1.0)
    667         {
     664        for(; lat >= max; lat -= 1.0) {
    668665            p = getPoint(new LatLon(lat <= max ? max : lat, lon));
    669666            path.lineTo(p.x, p.y);
    670667        }
    671668        lat = max; max = b.getMinLon();
    672         for(; lon >= max; lon -= 1.0)
    673         {
     669        for(; lon >= max; lon -= 1.0) {
    674670            p = getPoint(new LatLon(lat, lon <= max ? max : lon));
    675671            path.lineTo(p.x, p.y);
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r8384 r8395  
    693693            for (Node n : ds.searchNodes(getBBox(p, PROP_SNAP_DISTANCE.get()))) {
    694694                if (predicate.evaluate(n)
    695                         && (dist = getPoint2D(n).distanceSq(p)) < snapDistanceSq)
    696                 {
     695                        && (dist = getPoint2D(n).distanceSq(p)) < snapDistanceSq) {
    697696                    List<Node> nlist;
    698697                    if (nearestMap.containsKey(dist)) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java

    r8378 r8395  
    277277         * Hide the Panel, if there is nothing to show
    278278         */
    279         if (numPanels == 1 && panels.get(N-1).getComponents().length == 0)
    280         {
     279        if (numPanels == 1 && panels.get(N-1).getComponents().length == 0) {
    281280            parent.setDividerSize(0);
    282281            this.setVisible(false);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r8377 r8395  
    207207                KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0),
    208208                KeyStroke.getKeyStroke(KeyEvent.VK_F8, 0),
    209         })
    210         {
     209        }) {
    211210            layerList.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks, new Object());
    212211        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r8368 r8395  
    800800            }
    801801            StringBuilder text = new StringBuilder();
    802             if(ways != 0) {
     802            if (ways != 0) {
    803803                text.append(text.length() > 0 ? ", " : "")
    804804                .append(trn("{0} way", "{0} ways", ways, ways));
    805805            }
    806             if(nodes != 0) {
     806            if (nodes != 0) {
    807807                text.append(text.length() > 0 ? ", " : "")
    808808                .append(trn("{0} node", "{0} nodes", nodes, nodes));
    809809            }
    810             if(relations != 0) {
     810            if (relations != 0) {
    811811                text.append(text.length() > 0 ? ", " : "")
    812812                .append(trn("{0} relation", "{0} relations", relations, relations));
    813813            }
    814             if(ways + nodes + relations == 0) {
     814            if (ways + nodes + relations == 0) {
    815815                text.append(tr("Unselectable now"));
    816816                this.sel=new ArrayList<>(); // empty selection
    817817            }
    818             if(ways + nodes + relations == 1)
    819             {
     818            if (ways + nodes + relations == 1) {
    820819                text.append(": ");
    821820                for(OsmPrimitive o : sel) {
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserHistory.java

    r8318 r8395  
    6464            history = new ArrayList<>();
    6565        }
    66         if(add)
    67         {
     66        if (add) {
    6867            history.add(url);
    6968            historyPos = history.size()-1;
  • trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java

    r8285 r8395  
    343343        protected JTextField nextTF;
    344344
    345         public TFKeyListener (CredentialDialog owner, JTextField currentTF, JTextField nextTF)
    346         {
     345        public TFKeyListener (CredentialDialog owner, JTextField currentTF, JTextField nextTF) {
    347346            this.owner = owner;
    348347            this.currentTF = currentTF;
     
    368367
    369368        @Override
    370         public void keyReleased ( KeyEvent e ){
     369        public void keyReleased(KeyEvent e) {
    371370        }
    372371
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r8378 r8395  
    791791                    .getValue();
    792792
    793             if(result == 2)
    794             {
     793            if (result == 2) {
    795794                data.remove(currentPhoto);
    796795                if (currentPhoto >= data.size()) {
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r8390 r8395  
    436436
    437437    private static void playAdjacentMarker(Marker startMarker, boolean next) {
    438         Marker m = null;
    439438        if (!Main.isDisplayingMapView())
    440439            return;
     440        Marker m = null;
    441441        Layer l = Main.map.mapView.getActiveLayer();
    442         if(l != null) {
     442        if (l != null) {
    443443            m = getAdjacentMarker(startMarker, next, l);
    444444        }
    445         if(m == null)
    446         {
    447             for (Layer layer : Main.map.mapView.getAllLayers())
    448             {
     445        if (m == null) {
     446            for (Layer layer : Main.map.mapView.getAllLayers()) {
    449447                m = getAdjacentMarker(startMarker, next, layer);
    450                 if(m != null) {
     448                if (m != null) {
    451449                    break;
    452450                }
    453451            }
    454452        }
    455         if(m != null) {
     453        if (m != null) {
    456454            ((AudioMarker)m).play();
    457455        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r8377 r8395  
    165165        if (osm instanceof Node)
    166166            return generateStyles(osm, scale, false);
    167         else if (osm instanceof Way)
    168         {
     167        else if (osm instanceof Way) {
    169168            Pair<StyleList, Range> p = generateStyles(osm, scale, false);
    170169
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinePrototype.java

    r6986 r8395  
    3232    public LinePrototype() { init(); }
    3333
    34     public void init()
    35     {
     34    public void init() {
    3635        priority = 0;
    3736        range = Range.ZERO_TO_INFINITY;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinemodPrototype.java

    r6890 r8395  
    2929    public float getWidth(float ref) {
    3030        float res;
    31         if(widthMode == WidthMode.ABSOLUTE) {
     31        if (widthMode == WidthMode.ABSOLUTE) {
    3232            res = width;
    33         } else if(widthMode == WidthMode.OFFSET) {
     33        } else if (widthMode == WidthMode.OFFSET) {
    3434            res = ref + width;
    35         } else
    36         {
    37             if(width < 0) {
     35        } else {
     36            if (width < 0) {
    3837                res = 0;
    3938            } else {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r8345 r8395  
    171171        }
    172172        for (IconPrototype s : iconsList) {
    173             if (s.check(primitive))
    174             {
     173            if (s.check(primitive)) {
    175174                icon = update(icon, s, scale, mc);
    176175            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r8392 r8395  
    337337        @Override
    338338        public Object getValueAt(int rowIndex, int columnIndex) {
    339             if(currentAction.getAction() instanceof AdaptableAction)
    340             {
     339            if(currentAction.getAction() instanceof AdaptableAction) {
    341340                if (rowIndex < 2) {
    342341                    switch (columnIndex) {
     
    350349                } else {
    351350                    rowIndex -= 2;
    352             }
     351                }
    353352            }
    354353            ActionParameter<Object> param = getParam(rowIndex);
     
    370369        @Override
    371370        public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    372             if(currentAction.getAction() instanceof AdaptableAction)
    373             {
     371            if(currentAction.getAction() instanceof AdaptableAction) {
    374372                if (rowIndex == 0) {
    375373                     currentAction.setName((String)aValue);
     
    380378                } else {
    381379                    rowIndex -= 2;
    382             }
     380                }
    383381            }
    384382            ActionParameter<Object> param = getParam(rowIndex);
     
    944942        rootActionsNode.removeAllChildren();
    945943        loadAction(rootActionsNode, Main.main.menu);
    946         for(Map.Entry<String, Action> a : regactions.entrySet())
    947         {
    948             if(actions.get(a.getKey()) == null) {
     944        for (Map.Entry<String, Action> a : regactions.entrySet()) {
     945            if (actions.get(a.getKey()) == null) {
    949946                rootActionsNode.add(new DefaultMutableTreeNode(a.getValue()));
    950947            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java

    r8378 r8395  
    323323                label.setForeground(foregroundColor);
    324324            }
    325             if(pe.isChanged()) {
     325            if (pe.isChanged()) {
    326326                label.setBackground(changedColor);
    327             } else if(!pe.isDefault()) {
     327            } else if (!pe.isDefault()) {
    328328                label.setBackground(nonDefaultColor);
    329329            }
     
    333333            }
    334334            val = pe.getDefaultValue().getValue();
    335             if(val != null)
    336             {
    337                 if(pe.isDefault()) {
     335            if (val != null) {
     336                if (pe.isDefault()) {
    338337                    label.setToolTipText(tr("Current value is default."));
    339338                } else {
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r8377 r8395  
    184184            @Override
    185185            public void actionPerformed(ActionEvent e) {
    186                 for(int i = 0; i < colors.getRowCount(); ++i)
    187                 {
     186                for(int i = 0; i < colors.getRowCount(); ++i) {
    188187                    String name = (String)colors.getValueAt(i, 0);
    189188                    Color c = Main.pref.getDefaultColor(name);
     
    208207
    209208        colors = new JTable(tableModel) {
    210             @Override public boolean isCellEditable(int row, int column) {
     209            @Override
     210            public boolean isCellEditable(int row, int column) {
    211211                return false;
    212212            }
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r8390 r8395  
    235235            // and result in a malformed packet.
    236236            String[] chkstrings = s.split("\\*");
    237             if(chkstrings.length > 1)
    238             {
     237            if (chkstrings.length > 1) {
    239238                byte[] chb = chkstrings[0].getBytes(StandardCharsets.UTF_8);
    240239                int chk=0;
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java

    r8394 r8395  
    4343
    4444    @Override
    45     public String[] getMandatoryParams()
    46     {
    47         return new String[] { "lat", "lon" };
     45    public String[] getMandatoryParams() {
     46        return new String[] {"lat", "lon"};
    4847    }
    4948
    5049    @Override
    51     public String[] getOptionalParams()
    52     {
    53         return new String[] { "addtags" };
     50    public String[] getOptionalParams() {
     51        return new String[] {"addtags"};
    5452    }
    5553
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    r8394 r8395  
    249249     * @param command The command.
    250250     */
    251     public void setCommand(String command)
    252     {
     251    public void setCommand(String command) {
    253252        if (command.charAt(0) == '/') {
    254253            command = command.substring(1);
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r8390 r8395  
    245245        author = attr.getValue("Author");
    246246        iconPath = attr.getValue("Plugin-Icon");
    247         if (iconPath != null)
    248         {
     247        if (iconPath != null) {
    249248            if (file != null) {
    250249                // extract icon from the plugin jar file
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r8393 r8395  
    277277                            if (playingUrl != command.url() ||
    278278                                    stateChange != State.PAUSED ||
    279                                     offset != 0)
    280                             {
     279                                    offset != 0) {
    281280                                if (audioInputStream != null) {
    282281                                    Utils.close(audioInputStream);
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r8378 r8395  
    170170        bd[bdiagoff + bmid] = xlim;
    171171
    172         for (int c = 1;; ++c)
    173         {
     172        for (int c = 1;; ++c) {
    174173            int d;          /* Active diagonal. */
    175174            boolean big_snake = false;
     
    186185                --fmax;
    187186            }
    188             for (d = fmax; d >= fmin; d -= 2)
    189             {
     187            for (d = fmax; d >= fmin; d -= 2) {
    190188                int x, y, oldx, tlo = fd[fdiagoff + d - 1], thi = fd[fdiagoff + d + 1];
    191189
     
    204202                }
    205203                fd[fdiagoff + d] = x;
    206                 if (odd && bmin <= d && d <= bmax && bd[bdiagoff + d] <= fd[fdiagoff + d])
    207                 {
     204                if (odd && bmin <= d && d <= bmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) {
    208205                    cost = 2 * c - 1;
    209206                    return d;
     
    222219                --bmax;
    223220            }
    224             for (d = bmax; d >= bmin; d -= 2)
    225             {
     221            for (d = bmax; d >= bmin; d -= 2) {
    226222                int x, y, oldx, tlo = bd[bdiagoff + d - 1], thi = bd[bdiagoff + d + 1];
    227223
     
    240236                }
    241237                bd[bdiagoff + d] = x;
    242                 if (!odd && fmin <= d && d <= fmax && bd[bdiagoff + d] <= fd[fdiagoff + d])
    243                 {
     238                if (!odd && fmin <= d && d <= fmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) {
    244239                    cost = 2 * c;
    245240                    return d;
     
    255250       of changes, the algorithm is linear in the file size.  */
    256251
    257             if (c > 200 && big_snake && heuristic)
    258             {
     252            if (c > 200 && big_snake && heuristic) {
    259253                int best = 0;
    260254                int bestpos = -1;
    261255
    262                 for (d = fmax; d >= fmin; d -= 2)
    263                 {
     256                for (d = fmax; d >= fmin; d -= 2) {
    264257                    int dd = d - fmid;
    265258                    int x = fd[fdiagoff + d];
    266259                    int y = x - d;
    267260                    int v = (x - xoff) * 2 - dd;
    268                     if (v > 12 * (c + (dd < 0 ? -dd : dd)))
    269                     {
     261                    if (v > 12 * (c + (dd < 0 ? -dd : dd))) {
    270262                        if (v > best
    271263                                && xoff + SNAKE_LIMIT <= x && x < xlim
    272                                 && yoff + SNAKE_LIMIT <= y && y < ylim)
    273                         {
     264                                && yoff + SNAKE_LIMIT <= y && y < ylim) {
    274265                            /* We have a good enough best diagonal.
    275266                               now insist that it end with a significant snake.  */
     
    277268
    278269                            for (k = 1; xvec[x - k] == yvec[y - k]; k++)
    279                                 if (k == SNAKE_LIMIT)
    280                                 {
     270                                if (k == SNAKE_LIMIT) {
    281271                                    best = v;
    282272                                    bestpos = d;
     
    286276                    }
    287277                }
    288                 if (best > 0)
    289                 {
     278                if (best > 0) {
    290279                    cost = 2 * c - 1;
    291280                    return bestpos;
     
    293282
    294283                best = 0;
    295                 for (d = bmax; d >= bmin; d -= 2)
    296                 {
     284                for (d = bmax; d >= bmin; d -= 2) {
    297285                    int dd = d - bmid;
    298286                    int x = bd[bdiagoff + d];
    299287                    int y = x - d;
    300288                    int v = (xlim - x) * 2 + dd;
    301                     if (v > 12 * (c + (dd < 0 ? -dd : dd)))
    302                     {
     289                    if (v > 12 * (c + (dd < 0 ? -dd : dd))) {
    303290                        if (v > best
    304291                                && xoff < x && x <= xlim - SNAKE_LIMIT
    305                                 && yoff < y && y <= ylim - SNAKE_LIMIT)
    306                         {
     292                                && yoff < y && y <= ylim - SNAKE_LIMIT) {
    307293                            /* We have a good enough best diagonal.
    308294                               now insist that it end with a significant snake.  */
     
    310296
    311297                            for (k = 0; xvec[x + k] == yvec[y + k]; k++)
    312                                 if (k == SNAKE_LIMIT)
    313                                 {
     298                                if (k == SNAKE_LIMIT) {
    314299                                    best = v;
    315300                                    bestpos = d;
     
    319304                    }
    320305                }
    321                 if (best > 0)
    322                 {
     306                if (best > 0) {
    323307                    cost = 2 * c - 1;
    324308                    return bestpos;
     
    371355                   Let's verify that this is true.  */
    372356                throw new IllegalArgumentException("Empty subsequence");
    373             else
    374             {
     357            else {
    375358                /* Use that point to split this problem into two subproblems.  */
    376359                compareseq (xoff, b, yoff, b - d);
     
    425408        public  Change build_script(
    426409                final boolean[] changed0,int len0,
    427                 final boolean[] changed1,int len1)
    428         {
     410                final boolean[] changed1,int len1) {
    429411            Change script = null;
    430412            int i0 = 0, i1 = 0;
     
    459441        public Change build_script(
    460442                final boolean[] changed0,int len0,
    461                 final boolean[] changed1,int len1)
    462         {
     443                final boolean[] changed1,int len1) {
    463444            Change script = null;
    464445            int i0 = len0, i1 = len1;
    465446
    466             while (i0 >= 0 || i1 >= 0)
    467             {
    468                 if (changed0[i0] || changed1[i1])
    469                 {
     447            while (i0 >= 0 || i1 >= 0) {
     448                if (changed0[i0] || changed1[i1]) {
    470449                    int line0 = i0, line1 = i1;
    471450
     
    670649            }
    671650
    672             for (int i = 0; i < end; i++)
    673             {
     651            for (int i = 0; i < end; i++) {
    674652                int nmatch;
    675653                if (equivs[i] == 0) {
     
    694672            final int end = bufferedLines;
    695673
    696             for (int i = 0; i < end; i++)
    697             {
     674            for (int i = 0; i < end; i++) {
    698675                /* Cancel provisional discards not in middle of run of discards.  */
    699676                if (discards[i] == 2) {
    700677                    discards[i] = 0;
    701                 } else if (discards[i] != 0)
    702                 {
     678                } else if (discards[i] != 0) {
    703679                    /* We have found a nonprovisional discard.  */
    704680                    int j;
     
    708684                    /* Find end of this run of discardable lines.
    709685                       Count how many are provisionally discardable.  */
    710                     for (j = i; j < end; j++)
    711                     {
     686                    for (j = i; j < end; j++) {
    712687                        if (discards[j] == 0) {
    713688                            break;
     
    811786            int j = 0;
    812787            for (int i = 0; i < end; ++i)
    813                 if (noDiscards || discards[i] == 0)
    814                 {
     788                if (noDiscards || discards[i] == 0) {
    815789                    undiscarded[j] = equivs[i];
    816790                    realindexes[j++] = i;
     
    853827      @param f the file being compared against
    854828         */
    855 
    856829        void shift_boundaries(FileData f) {
    857830            final boolean[] changed = changedFlag;
     
    863836            int other_preceding = -1;
    864837
    865             for (;;)
    866             {
     838            for (;;) {
    867839                int start, end, other_start;
    868840
     
    870842                   Also keep track of the corresponding point in the other file.  */
    871843
    872                 while (i < i_end && !changed[1+i])
    873                 {
     844                while (i < i_end && !changed[1+i]) {
    874845                    while (other_changed[1+j++]) {
    875846                        /* Non-corresponding lines in the other file
     
    887858                other_start = j;
    888859
    889                 for (;;)
    890                 {
     860                for (;;) {
    891861                    /* Now find the end of this run of changes.  */
    892862
     
    905875                       Only because the previous run was shifted here.  */
    906876
    907                     if (end != i_end
    908                             && equivs[start] == equivs[end]
    909                                                        && !other_changed[1+j]
    910                                                                          && !((preceding >= 0 && start == preceding)
    911                                                                                  || (other_preceding >= 0
    912                                                                                          && other_start == other_preceding)))
    913                     {
     877                    if (end != i_end && equivs[start] == equivs[end] && !other_changed[1+j]
     878                         && !((preceding >= 0 && start == preceding) || (other_preceding >= 0 && other_start == other_preceding))) {
    914879                        changed[1+end++] = true;
    915880                        changed[1+start++] = false;
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r8393 r8395  
    601601            if ((newPoint.getEastNorth().getY() < point.getEastNorth().getY()) == (point.getEastNorth().getY() <= oldPoint.getEastNorth().getY())
    602602                    && (point.getEastNorth().getX() - p1.getEastNorth().getX()) * (p2.getEastNorth().getY() - p1.getEastNorth().getY())
    603                     < (p2.getEastNorth().getX() - p1.getEastNorth().getX()) * (point.getEastNorth().getY() - p1.getEastNorth().getY()))
    604             {
     603                    < (p2.getEastNorth().getX() - p1.getEastNorth().getX()) * (point.getEastNorth().getY() - p1.getEastNorth().getY())) {
    605604                inside = !inside;
    606605            }
     
    638637    }
    639638
    640     protected static double calcX(Node p1){
     639    protected static double calcX(Node p1) {
    641640        double lat1, lon1, lat2, lon2;
    642641        double dlon, dlat;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r8393 r8395  
    935935                        return svg == null ? null : new ImageResource(svg);
    936936                    case OTHER:
    937                         while(size > 0)
    938                         {
     937                        while(size > 0) {
    939938                            int l = is.read(buf, offs, size);
    940939                            offs += l;
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r8380 r8395  
    253253    public static List<Shortcut> listAll() {
    254254        List<Shortcut> l = new ArrayList<>();
    255         for(Shortcut c : shortcuts.values())
    256         {
    257             if(!"core:none".equals(c.shortText)) {
     255        for (Shortcut c : shortcuts.values()) {
     256            if (!"core:none".equals(c.shortText)) {
    258257                l.add(c);
    259258            }
Note: See TracChangeset for help on using the changeset viewer.