Changeset 8465 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2015-06-04T01:52:36+02:00 (9 years ago)
Author:
Don-vip
Message:

minor code style issues

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

Legend:

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

    r8449 r8465  
    107107            // Build a new list of VM parameters to modify it below if needed (default implementation returns an UnmodifiableList instance)
    108108            List<String> vmArguments = new ArrayList<>(ManagementFactory.getRuntimeMXBean().getInputArguments());
    109             for (ListIterator<String> it = vmArguments.listIterator(); it.hasNext(); ) {
     109            for (ListIterator<String> it = vmArguments.listIterator(); it.hasNext();) {
    110110                String value = it.next();
    111111                if (value.contains("=")) {
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r8443 r8465  
    228228        for (int i=1; i<selectedNodes.size(); i++) {
    229229            List<OsmPrimitive> ref = selectedNodes.get(i).getReferrers();
    230             for (Iterator<Way> it = result.iterator(); it.hasNext(); ) {
     230            for (Iterator<Way> it = result.iterator(); it.hasNext();) {
    231231                if (!ref.contains(it.next())) {
    232232                    it.remove();
     
    236236
    237237        // Remove broken ways
    238         for (Iterator<Way> it = result.iterator(); it.hasNext(); ) {
     238        for (Iterator<Way> it = result.iterator(); it.hasNext();) {
    239239            if (it.next().getNodesCount() <= 2) {
    240240                it.remove();
     
    246246        else {
    247247            // Return only selected ways
    248             for (Iterator<Way> it = result.iterator(); it.hasNext(); ) {
     248            for (Iterator<Way> it = result.iterator(); it.hasNext();) {
    249249                if (!selectedWays.contains(it.next())) {
    250250                    it.remove();
  • trunk/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java

    r8378 r8465  
    157157        for (int i=1; i<selectedNodes.size(); i++) {
    158158            List<OsmPrimitive> ref = selectedNodes.get(i).getReferrers();
    159             for (Iterator<Way> it = result.iterator(); it.hasNext(); ) {
     159            for (Iterator<Way> it = result.iterator(); it.hasNext();) {
    160160                if (!ref.contains(it.next())) {
    161161                    it.remove();
     
    165165
    166166        // Remove broken ways
    167         for (Iterator<Way> it = result.iterator(); it.hasNext(); ) {
     167        for (Iterator<Way> it = result.iterator(); it.hasNext();) {
    168168            if (it.next().getNodesCount() <= 2) {
    169169                it.remove();
     
    175175        else {
    176176            // Return only selected ways
    177             for (Iterator<Way> it = result.iterator(); it.hasNext(); ) {
     177            for (Iterator<Way> it = result.iterator(); it.hasNext();) {
    178178                if (!selectedWays.contains(it.next())) {
    179179                    it.remove();
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r8444 r8465  
    15451545                if (selectedWays.size()==1) {
    15461546                    Way w = selectedWays.iterator().next();
    1547                     Collection <EastNorth> pointsToProject = new ArrayList<>();
     1547                    Collection<EastNorth> pointsToProject = new ArrayList<>();
    15481548                    if (w.getNodesCount()<1000) {
    15491549                        for (Node n: w.getNodes()) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r8449 r8465  
    340340            Main.map.mapView.setNewCursor(ctrl ? cursorTranslate : alt ? cursorCreateNew : shift ? cursorCreateNodes : cursor, this);
    341341        }
    342     };
     342    }
    343343
    344344    @Override
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r8443 r8465  
    13871387            } else if (f.getType().isAssignableFrom(Map.class)) {
    13881388                value = mapFromJson(key_value.getValue());
    1389             }
    1390             else
     1389            } else
    13911390                throw new RuntimeException("unsupported preference primitive type");
    13921391
  • trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java

    r8456 r8465  
    3838 * </ul>
    3939 */
    40 public class ConflictCollection implements Iterable<Conflict<? extends OsmPrimitive>>{
     40public class ConflictCollection implements Iterable<Conflict<? extends OsmPrimitive>> {
    4141    private final List<Conflict<? extends OsmPrimitive>> conflicts;
    4242    private CopyOnWriteArrayList<IConflictListener> listeners;
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r8444 r8465  
    109109            }
    110110        }
    111         while (defaultLayers.remove(null));
     111        while (defaultLayers.remove(null)) {
     112            // Do nothing
     113        }
    112114        Collections.sort(defaultLayers);
    113115        buildIdMap(defaultLayers, defaultLayerIds);
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r8237 r8465  
    296296                DataSet ds = dataSet;
    297297                // Find DataSet (can be null for several nodes when undoing nodes creation, see #7162)
    298                 for (Iterator<Node> it = nodes.iterator(); it.hasNext() && ds == null; ) {
     298                for (Iterator<Node> it = nodes.iterator(); it.hasNext() && ds == null;) {
    299299                    ds = it.next().getDataSet();
    300300                }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r8448 r8465  
    355355
    356356        private static void removeMetaRules(MapCSSStyleSource source) {
    357             for (Iterator<MapCSSRule> it = source.rules.iterator(); it.hasNext(); ) {
     357            for (Iterator<MapCSSRule> it = source.rules.iterator(); it.hasNext();) {
    358358                MapCSSRule x = it.next();
    359359                if (x.selector instanceof GeneralSelector) {
  • trunk/src/org/openstreetmap/josm/gui/FileDrop.java

    r8459 r8465  
    131131                @Override
    132132                public void dragEnter(DropTargetDragEvent evt) {
    133                     Main.trace("FileDrop: dragEnter event." );
     133                    Main.trace("FileDrop: dragEnter event.");
    134134
    135135                    // Is this an acceptable drag event?
    136                     if (isDragOk(evt) ) {
     136                    if (isDragOk(evt)) {
    137137                        // If it's a Swing component, set its border
    138138                        if (c instanceof JComponent) {
     
    145145
    146146                        // Acknowledge that it's okay to enter
    147                         evt.acceptDrag( DnDConstants.ACTION_COPY);
     147                        evt.acceptDrag(DnDConstants.ACTION_COPY);
    148148                        Main.trace("FileDrop: event accepted.");
    149149                    } else {
     
    254254                    Main.debug("FileDrop: dropActionChanged event.");
    255255                    // Is this an acceptable drag event?
    256                     if (isDragOk(evt) ) {
    257                         evt.acceptDrag( DnDConstants.ACTION_COPY);
     256                    if (isDragOk(evt)) {
     257                        evt.acceptDrag(DnDConstants.ACTION_COPY);
    258258                        Main.debug("FileDrop: event accepted.");
    259259                    } else {
     
    369369            // Is the flavor a file list?
    370370            final DataFlavor curFlavor = flavors[i];
    371             if (curFlavor.equals( DataFlavor.javaFileListFlavor ) ||
    372                     curFlavor.isRepresentationClassReader()){
     371            if (curFlavor.equals(DataFlavor.javaFileListFlavor) ||
     372                    curFlavor.isRepresentationClassReader()) {
    373373                ok = true;
    374374            }
     
    637637
    638638            // String
    639             if (flavor.equals( DataFlavor.stringFlavor))
     639            if (flavor.equals(DataFlavor.stringFlavor))
    640640                return true;
    641641
  • trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java

    r8443 r8465  
    169169            // For layers containing complex shapes, check that center is in one
    170170            // of its shapes (fix #7910)
    171             for (Iterator<ImageryInfo> iti = inViewLayers.iterator(); iti.hasNext(); ) {
     171            for (Iterator<ImageryInfo> iti = inViewLayers.iterator(); iti.hasNext();) {
    172172                List<Shape> shapes = iti.next().getBounds().getShapes();
    173173                if (shapes != null && !shapes.isEmpty()) {
    174174                    boolean found = false;
    175                     for (Iterator<Shape> its = shapes.iterator(); its.hasNext() && !found; ) {
     175                    for (Iterator<Shape> its = shapes.iterator(); its.hasNext() && !found;) {
    176176                        found = its.next().contains(pos);
    177177                    }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModel.java

    r8444 r8465  
    1818import org.openstreetmap.josm.gui.conflict.pair.ListRole;
    1919
    20 public class NodeListMergeModel extends ListMergeModel<Node>{
     20public class NodeListMergeModel extends ListMergeModel<Node> {
    2121
    2222    /**
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java

    r8444 r8465  
    2121 *
    2222 */
    23 public class RelationMemberListMergeModel extends ListMergeModel<RelationMember>{
     23public class RelationMemberListMergeModel extends ListMergeModel<RelationMember> {
    2424
    2525    @Override
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java

    r8332 r8465  
    217217    public void windowClosed(WindowEvent e) {
    218218        RelationEditor editor = (RelationEditor)e.getWindow();
    219         for (Iterator<Entry<DialogContext, RelationEditor>> it = openDialogs.entrySet().iterator(); it.hasNext(); ) {
     219        for (Iterator<Entry<DialogContext, RelationEditor>> it = openDialogs.entrySet().iterator(); it.hasNext();) {
    220220            if (editor.equals(it.next().getValue())) {
    221221                it.remove();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r8444 r8465  
    338338     */
    339339    public List<TestError> getErrors() {
    340         return errors != null ? errors : Collections.<TestError> emptyList();
     340        return errors != null ? errors : Collections.<TestError>emptyList();
    341341    }
    342342
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java

    r8346 r8465  
    108108     */
    109109    public void hide(HistoryBrowserDialog dialog) {
    110         for (Iterator<Entry<Long, HistoryBrowserDialog>> it = dialogs.entrySet().iterator(); it.hasNext(); ) {
     110        for (Iterator<Entry<Long, HistoryBrowserDialog>> it = dialogs.entrySet().iterator(); it.hasNext();) {
    111111            if (Objects.equals(it.next().getValue(), dialog)) {
    112112                it.remove();
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionListItem.java

    r8390 r8465  
    1717 *
    1818 */
    19 public class AutoCompletionListItem implements Comparable<AutoCompletionListItem>{
     19public class AutoCompletionListItem implements Comparable<AutoCompletionListItem> {
    2020
    2121    /** the pritority of this item */
  • trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java

    r8444 r8465  
    2424     * @param prims - primitives to highlight/unhighlight
    2525     */
    26     public boolean highlight(Collection <? extends OsmPrimitive> prims) {
     26    public boolean highlight(Collection<? extends OsmPrimitive> prims) {
    2727        return highlight(prims, false);
    2828    }
     
    3333     * @param only - remove previous highlighting
    3434     */
    35     public boolean highlight(Collection <? extends OsmPrimitive> prims, boolean only) {
     35    public boolean highlight(Collection<? extends OsmPrimitive> prims, boolean only) {
    3636        boolean needsRepaint = false;
    3737        if (only) {
     
    5757     * @param prims - primitives to highlight/unhighlight
    5858     */
    59     public boolean highlightOnly(Collection <? extends OsmPrimitive> prims) {
     59    public boolean highlightOnly(Collection<? extends OsmPrimitive> prims) {
    6060        return highlight(prims, true);
    6161    }
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java

    r8419 r8465  
    532532                    Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);
    533533                    layout2(splitChild, newSplitChildBounds);
    534                 }
    535                 else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) {
     534                } else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) {
    536535                    double allocatedHeight = (splitChild.equals(lastWeightedChild))
    537536                    ? availableHeight
     
    541540                    layout2(splitChild, newSplitChildBounds);
    542541                    availableHeight -= allocatedHeight;
    543                 }
    544                 else {
     542                } else {
    545543                    double existingHeight = splitChildBounds.getHeight();
    546544                    Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, existingHeight);
     
    619617                    if (getFloatingDividers()) {
    620618                        childWidth = preferredNodeSize(splitChild).getWidth();
    621                     }
    622                     else {
     619                    } else {
    623620                        if (dividerChild != null) {
    624621                            childWidth = dividerChild.getBounds().getX() - x;
    625                         }
    626                         else {
     622                        } else {
    627623                            childWidth = split.getBounds().getMaxX() - x;
    628624                        }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java

    r8339 r8465  
    33
    44import java.io.File;
    5 import java.net.InetAddress;
    65import java.net.Inet4Address;
    76import java.net.Inet6Address;
     7import java.net.InetAddress;
    88import java.net.UnknownHostException;
    99
     
    9090                return a;
    9191            }
    92         };
     92        }
    9393        throw new UnknownHostException();
    9494    }
     
    106106                return a;
    107107            }
    108         };
     108        }
    109109        throw new UnknownHostException();
    110110    }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r8390 r8465  
    176176            String command = questionPos < 0 ? url : url.substring(0, questionPos);
    177177
    178             Map <String,String> headers = new HashMap<>();
     178            Map<String,String> headers = new HashMap<>();
    179179            int k=0, MAX_HEADERS=20;
    180180            while (k<MAX_HEADERS) {
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r8453 r8465  
    12831283
    12841284        Set<String> plugins = new HashSet<>(
    1285                 Main.pref.getCollection("plugins",Collections.<String> emptySet())
     1285                Main.pref.getCollection("plugins",Collections.<String>emptySet())
    12861286        );
    12871287        final PluginInformation pluginInfo = plugin.getPluginInformation();
     
    13241324    public static String getBugReportText() {
    13251325        StringBuilder text = new StringBuilder();
    1326         List <String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>()));
     1326        List<String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>()));
    13271327        for (final PluginProxy pp : pluginList) {
    13281328            PluginInformation pi = pp.getPluginInformation();
Note: See TracChangeset for help on using the changeset viewer.