Ignore:
Timestamp:
2016-06-15T10:30:37+02:00 (3 years ago)
Author:
Don-vip
Message:

Checkstyle 6.19: enable SingleSpaceSeparator and fix violations

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
27 edited

Legend:

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

    r9917 r10378  
    6262     */
    6363    public static boolean confirmLaunchMultiple(int numBrowsers) {
    64         String msg  = /* for correct i18n of plural forms - see #9110 */ trn(
     64        String msg = /* for correct i18n of plural forms - see #9110 */ trn(
    6565                "You are about to launch {0} browser window.<br>"
    6666                        + "This may both clutter your screen with browser windows<br>"
  • trunk/src/org/openstreetmap/josm/actions/AbstractSelectAction.java

    r10369 r10378  
    1919    public AbstractSelectAction() {
    2020        putValue(NAME, tr("Select"));
    21         putValue(SHORT_DESCRIPTION,  tr("Set the selected elements on the map to the selected items in the list above."));
     21        putValue(SHORT_DESCRIPTION, tr("Set the selected elements on the map to the selected items in the list above."));
    2222        new ImageProvider("dialogs", "select").getResource().attachImageIcon(this, true);
    2323    }
  • trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    r10308 r10378  
    271271                    delta = pcLast.angle - pcFirst.angle;
    272272                    if (delta < 0) // Assume each PolarCoor.angle is in range ]-pi; pi]
    273                         delta +=  2*Math.PI;
     273                        delta += 2*Math.PI;
    274274                    delta /= j - i;
    275275                }
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r10347 r10378  
    336336            return lines.get(0).projectionCommand(node);
    337337        else if (lines.size() == 2)
    338             return lines.get(0).intersectionCommand(node,  lines.get(1));
     338            return lines.get(0).intersectionCommand(node, lines.get(1));
    339339        throw new InvalidSelection();
    340340    }
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r10250 r10378  
    569569                return null;
    570570            Stack<NodePair> path = new Stack<>();
    571             Stack<NodePair> nextPairs  = new Stack<>();
     571            Stack<NodePair> nextPairs = new Stack<>();
    572572            nextPairs.addAll(getOutboundPairs(startNode));
    573573            while (!nextPairs.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java

    r10043 r10378  
    166166        if (nodes.size() == 2) {
    167167            // diameter: two single nodes needed or a way with two nodes
    168             Node   n1 = nodes.get(0);
     168            Node n1 = nodes.get(0);
    169169            double x1 = n1.getEastNorth().east();
    170170            double y1 = n1.getEastNorth().north();
    171             Node   n2 = nodes.get(1);
     171            Node n2 = nodes.get(1);
    172172            double x2 = n2.getEastNorth().east();
    173173            double y2 = n2.getEastNorth().north();
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r10010 r10378  
    7070        super(getName(update), /* ICON */ "multipoly_create", getName(update),
    7171                /* atleast three lines for each shortcut or the server extractor fails */
    72                 update  ? Shortcut.registerShortcut("tools:multipoly_update",
     72                update ? Shortcut.registerShortcut("tools:multipoly_update",
    7373                            tr("Tool: {0}", getName(true)),
    7474                            KeyEvent.VK_B, Shortcut.CTRL_SHIFT)
    75                         : Shortcut.registerShortcut("tools:multipoly_create",
     75                       : Shortcut.registerShortcut("tools:multipoly_create",
    7676                            tr("Tool: {0}", getName(false)),
    7777                            KeyEvent.VK_B, Shortcut.CTRL),
  • trunk/src/org/openstreetmap/josm/actions/HistoryInfoWebAction.java

    r9136 r10378  
    3131
    3232    @Override
    33     protected  String createInfoUrl(Object infoObject) {
     33    protected String createInfoUrl(Object infoObject) {
    3434        if (infoObject instanceof OsmPrimitive) {
    3535            OsmPrimitive primitive = (OsmPrimitive) infoObject;
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r10308 r10378  
    291291         * @return The next way.
    292292         */
    293         public  WayInPolygon walk() {
     293        public WayInPolygon walk() {
    294294            Node headNode = getHeadNode();
    295295            Node prevNode = getPrevNode();
     
    12171217     * @throws UserCancelException if user cancels the operation
    12181218     */
    1219     private Multipolygon  joinPolygon(AssembledMultipolygon polygon) throws UserCancelException {
     1219    private Multipolygon joinPolygon(AssembledMultipolygon polygon) throws UserCancelException {
    12201220        Multipolygon result = new Multipolygon(joinWays(polygon.outerWay.ways));
    12211221
     
    14401440
    14411441                cmds.add(new ChangeCommand(r, newRel));
    1442                 RelationRole saverel =  new RelationRole(r, rm.getRole());
     1442                RelationRole saverel = new RelationRole(r, rm.getRole());
    14431443                if (!result.contains(saverel)) {
    14441444                    result.add(saverel);
  • trunk/src/org/openstreetmap/josm/actions/MoveAction.java

    r9067 r10378  
    3434    private static String calltosupermustbefirststatementinconstructortext(Direction dir) {
    3535        String directiontext;
    36         if        (dir == Direction.UP)  {
     36        if (dir == Direction.UP) {
    3737            directiontext = tr("up");
    38         } else if (dir == Direction.DOWN)  {
     38        } else if (dir == Direction.DOWN) {
    3939            directiontext = tr("down");
    40         } else if (dir == Direction.LEFT)  {
     40        } else if (dir == Direction.LEFT) {
    4141            directiontext = tr("left");
    4242        } else {
     
    4949    private static Shortcut calltosupermustbefirststatementinconstructor(Direction dir) {
    5050        Shortcut sc;
    51         if        (dir == Direction.UP)   {
    52             sc = Shortcut.registerShortcut("core:moveup",    tr("Move objects {0}", tr("up")), KeyEvent.VK_UP,    Shortcut.SHIFT);
    53         } else if (dir == Direction.DOWN)  {
    54             sc = Shortcut.registerShortcut("core:movedown",  tr("Move objects {0}", tr("down")), KeyEvent.VK_DOWN,  Shortcut.SHIFT);
    55         } else if (dir == Direction.LEFT)  {
    56             sc = Shortcut.registerShortcut("core:moveleft",  tr("Move objects {0}", tr("left")), KeyEvent.VK_LEFT,  Shortcut.SHIFT);
     51        // CHECKSTYLE.OFF: SingleSpaceSeparator
     52        if (dir == Direction.UP) {
     53            sc = Shortcut.registerShortcut("core:moveup",    tr("Move objects {0}", tr("up")),    KeyEvent.VK_UP,    Shortcut.SHIFT);
     54        } else if (dir == Direction.DOWN) {
     55            sc = Shortcut.registerShortcut("core:movedown",  tr("Move objects {0}", tr("down")),  KeyEvent.VK_DOWN,  Shortcut.SHIFT);
     56        } else if (dir == Direction.LEFT) {
     57            sc = Shortcut.registerShortcut("core:moveleft",  tr("Move objects {0}", tr("left")),  KeyEvent.VK_LEFT,  Shortcut.SHIFT);
    5758        } else { //dir == Direction.RIGHT
    5859            sc = Shortcut.registerShortcut("core:moveright", tr("Move objects {0}", tr("right")), KeyEvent.VK_RIGHT, Shortcut.SHIFT);
    5960        }
     61        // CHECKSTYLE.ON: SingleSpaceSeparator
    6062        return sc;
    6163    }
     
    7173        myDirection = dir;
    7274        putValue("help", ht("/Action/Move"));
    73         if        (dir == Direction.UP)  {
     75        if (dir == Direction.UP) {
    7476            putValue("toolbar", "action/move/up");
    75         } else if (dir == Direction.DOWN)  {
     77        } else if (dir == Direction.DOWN) {
    7678            putValue("toolbar", "action/move/down");
    77         } else if (dir == Direction.LEFT)  {
     79        } else if (dir == Direction.LEFT) {
    7880            putValue("toolbar", "action/move/left");
    7981        } else { //dir == Direction.RIGHT
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r10250 r10378  
    191191        } else if (wayDataList.isEmpty()) {
    192192            throw new InvalidUserInputException("usage");
    193         } else  {
     193        } else {
    194194            if (nodeList.size() == 2 || nodeList.isEmpty()) {
    195195                OrthogonalizeAction.rememberMovements.clear();
     
    401401            EastNorth tmp = new EastNorth(nX.get(n), nY.get(n));
    402402            tmp = EN.rotateCC(pivot, tmp, headingAll);
    403             final double dx = tmp.east()  - n.getEastNorth().east();
     403            final double dx = tmp.east() - n.getEastNorth().east();
    404404            final double dy = tmp.north() - n.getEastNorth().north();
    405405            if (headingNodes.contains(n)) { // The heading nodes should not have changed
     
    467467            for (int i = 0; i < nSeg; ++i) {
    468468                EastNorth segment = EN.diff(en[i+1], en[i]);
    469                 if      (segDirections[i] == Direction.RIGHT) {
     469                if (segDirections[i] == Direction.RIGHT) {
    470470                    h = EN.sum(h, segment);
    471471                } else if (segDirections[i] == Direction.UP) {
     
    544544            double x = en.east() - pivot.east();
    545545            double y = en.north() - pivot.north();
    546             double nx =  cosPhi * x - sinPhi * y + pivot.east();
    547             double ny =  sinPhi * x + cosPhi * y + pivot.north();
     546            double nx = cosPhi * x - sinPhi * y + pivot.east();
     547            double ny = sinPhi * x + cosPhi * y + pivot.north();
    548548            return new EastNorth(nx, ny);
    549549        }
     
    558558
    559559        public static double polar(EastNorth en1, EastNorth en2) {
    560             return Math.atan2(en2.north() - en1.north(), en2.east() -  en1.east());
     560            return Math.atan2(en2.north() - en1.north(), en2.east() - en1.east());
    561561        }
    562562    }
     
    572572    private static int angleToDirectionChange(double a, double deltaMax) throws RejectedAngleException {
    573573        a = standard_angle_mPI_to_PI(a);
    574         double d0   = Math.abs(a);
    575         double d90  = Math.abs(a - Math.PI / 2);
     574        double d0 = Math.abs(a);
     575        double d90 = Math.abs(a - Math.PI / 2);
    576576        double dm90 = Math.abs(a + Math.PI / 2);
    577577        int dirChange;
    578578        if (d0 < deltaMax) {
    579             dirChange =  0;
     579            dirChange = 0;
    580580        } else if (d90 < deltaMax) {
    581             dirChange =  1;
     581            dirChange = 1;
    582582        } else if (dm90 < deltaMax) {
    583583            dirChange = -1;
  • trunk/src/org/openstreetmap/josm/actions/PasteAction.java

    r10216 r10378  
    113113        }
    114114
    115         double offsetEast  = mPosition.east() - (maxEast + minEast)/2.0;
     115        double offsetEast = mPosition.east() - (maxEast + minEast)/2.0;
    116116        double offsetNorth = mPosition.north() - (maxNorth + minNorth)/2.0;
    117117
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r9233 r10378  
    6464    public PurgeAction() {
    6565        /* translator note: other expressions for "purge" might be "forget", "clean", "obliterate", "prune" */
    66         super(tr("Purge..."), "purge",  tr("Forget objects but do not delete them on server when uploading."),
     66        super(tr("Purge..."), "purge", tr("Forget objects but do not delete them on server when uploading."),
    6767                Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")),
    6868                KeyEvent.VK_P, Shortcut.CTRL_SHIFT),
     
    272272            JButton addToSelection = new JButton(new AbstractAction() {
    273273                {
    274                     putValue(SHORT_DESCRIPTION,   tr("Add to selection"));
     274                    putValue(SHORT_DESCRIPTION, tr("Add to selection"));
    275275                    putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
    276276                }
  • trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    r9972 r10378  
    137137     */
    138138    protected boolean isRequiredNode(Way way, Node node) {
    139         boolean isRequired =  Collections.frequency(way.getNodes(), node) > 1;
     139        boolean isRequired = Collections.frequency(way.getNodes(), node) > 1;
    140140        if (!isRequired) {
    141141            List<OsmPrimitive> parents = new LinkedList<>();
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r10254 r10378  
    139139            if (tmpNodes.isEmpty()) {
    140140                if (selection.size() > 1) {
    141                     errMsg =  tr("None of these nodes are glued to anything else.");
     141                    errMsg = tr("None of these nodes are glued to anything else.");
    142142                } else {
    143143                    errMsg = tr("None of this way''s nodes are glued to anything else.");
  • trunk/src/org/openstreetmap/josm/actions/ValidateAction.java

    r9067 r10378  
    126126                Collection<OsmPrimitive> formerValidatedPrimitives) {
    127127            super(tr("Validating"), false /*don't ignore exceptions */);
    128             this.validatedPrimitives  = validatedPrimitives;
     128            this.validatedPrimitives = validatedPrimitives;
    129129            this.formerValidatedPrimitives = formerValidatedPrimitives;
    130130            this.tests = tests;
     
    142142            // update GUI on Swing EDT
    143143            //
    144             GuiHelper.runInEDT(new Runnable()  {
     144            GuiHelper.runInEDT(new Runnable() {
    145145                @Override
    146146                public void run() {
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/ChangesetQueryTask.java

    r10250 r10378  
    7171                // thrown if user cancel the authentication dialog
    7272                setCanceled(true);
    73             }  catch (OsmTransferException e) {
     73            } catch (OsmTransferException e) {
    7474                if (isCanceled())
    7575                    return;
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java

    r10001 r10378  
    1919public class DownloadOsmCompressedTask extends DownloadOsmTask {
    2020
    21     private static final String PATTERN_COMPRESS =  "https?://.*/.*\\.osm.(gz|bz2?|zip)";
     21    private static final String PATTERN_COMPRESS = "https?://.*/.*\\.osm.(gz|bz2?|zip)";
    2222
    2323    @Override
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r10371 r10378  
    3737public class DownloadOsmTask extends AbstractDownloadTask<DataSet> {
    3838
     39    // CHECKSTYLE.OFF: SingleSpaceSeparator
    3940    protected static final String PATTERN_OSM_API_URL           = "https?://.*/api/0.6/(map|nodes?|ways?|relations?|\\*).*";
    4041    protected static final String PATTERN_OVERPASS_API_URL      = "https?://.*/interpreter\\?data=.*";
    4142    protected static final String PATTERN_OVERPASS_API_XAPI_URL = "https?://.*/xapi(\\?.*\\[@meta\\]|_meta\\?).*";
    4243    protected static final String PATTERN_EXTERNAL_OSM_FILE     = "https?://.*/.*\\.osm";
     44    // CHECKSTYLE.ON: SingleSpaceSeparator
    4345
    4446    protected Bounds currentBounds;
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java

    r9171 r10378  
    2121public class DownloadSessionTask extends AbstractDownloadTask<Object> {
    2222
    23     private static final String PATTERN_SESSION =  "https?://.*/.*\\.jo(s|z)";
     23    private static final String PATTERN_SESSION = "https?://.*/.*\\.jo(s|z)";
    2424
    2525    private Loader loader;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r10308 r10378  
    691691            int posn0 = selectedWay.getNodes().indexOf(currentNode);
    692692            if (posn0 != -1 && // n0 is part of way
    693                     (posn0 >= 1                             && targetNode.equals(selectedWay.getNode(posn0-1))) || // previous node
    694                     (posn0 < selectedWay.getNodesCount()-1) && targetNode.equals(selectedWay.getNode(posn0+1))) {  // next node
     693                  // CHECKSTYLE.OFF: SingleSpaceSeparator
     694                  (posn0 >= 1                             && targetNode.equals(selectedWay.getNode(posn0-1))) || // previous node
     695                  (posn0 < selectedWay.getNodesCount()-1) && targetNode.equals(selectedWay.getNode(posn0+1))) {  // next node
     696                  // CHECKSTYLE.ON: SingleSpaceSeparator
    695697                getCurrentDataSet().setSelected(targetNode);
    696698                lastUsedNode = targetNode;
     
    845847     * uses also lastUsedNode field
    846848     */
    847     private void determineCurrentBaseNodeAndPreviousNode(Collection<OsmPrimitive>  selection) {
     849    private void determineCurrentBaseNodeAndPreviousNode(Collection<OsmPrimitive> selection) {
    848850        Node selectedNode = null;
    849851        Way selectedWay = null;
     
    12831285                        n = (Node) p; // found one node
    12841286                        wayIsFinished = false;
    1285                     }  else {
     1287                    } else {
    12861288                        // if more than 1 node were affected by previous command,
    12871289                        // we have no way to continue, so we forget about found node
     
    16591661                    }
    16601662                    if (enOpt != null) {
    1661                         projectionSource =  enOpt;
     1663                        projectionSource = enOpt;
    16621664                    }
    16631665                }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r10308 r10378  
    822822                    initialN2en.getX() - en.getX(),
    823823                    initialN2en.getY() - en.getY()
    824                     ), initialN2en,  en, false));
     824                    ), initialN2en, en, false));
    825825        }
    826826    }
     
    835835        possibleMoveDirections = new ArrayList<>();
    836836        for (OsmPrimitive p: selectedNode.getReferrers()) {
    837             if (p instanceof Way  && p.isUsable()) {
     837            if (p instanceof Way && p.isUsable()) {
    838838                for (Node neighbor: ((Way) p).getNeighbours(selectedNode)) {
    839839                    EastNorth en = neighbor.getEastNorth();
     
    905905            initialN2en.getX() - nextNodeEn.getX(),
    906906            initialN2en.getY() - nextNodeEn.getY()
    907             ), initialN2en,  nextNodeEn, false);
     907            ), initialN2en, nextNodeEn, false);
    908908    }
    909909
     
    985985    private int getNextNodeIndex(int index) {
    986986        int count = selectedSegment.way.getNodesCount();
    987         if (index <  count - 1)
     987        if (index < count - 1)
    988988            return index + 1;
    989989        else if (selectedSegment.way.isClosed())
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ModifiersSpec.java

    r9970 r10378  
    2525        char c = str.charAt(2);
    2626        // @formatter:off
     27        // CHECKSTYLE.OFF: SingleSpaceSeparator
    2728        alt   = a == '?' ? UNKNOWN : (a == 'A' ? ON : OFF);
    2829        shift = s == '?' ? UNKNOWN : (s == 'S' ? ON : OFF);
    2930        ctrl  = c == '?' ? UNKNOWN : (c == 'C' ? ON : OFF);
     31        // CHECKSTYLE.ON: SingleSpaceSeparator
    3032        // @formatter:on
    3133    }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r10220 r10378  
    205205    private void updateModeLocalPreferences() {
    206206        // @formatter:off
     207        // CHECKSTYLE.OFF: SingleSpaceSeparator
    207208        snapThreshold        = Main.pref.getDouble(prefKey("snap-threshold-percent"), 0.70);
    208209        snapDefault          = Main.pref.getBoolean(prefKey("snap-default"),      true);
     
    219220        toggleSelectedModifierCombo = new ModifiersSpec(getStringPref("toggle-selection-modifier-combo", "asC"));
    220221        setSelectedModifierCombo    = new ModifiersSpec(getStringPref("set-selection-modifier-combo",    "asc"));
     222        // CHECKSTYLE.ON: SingleSpaceSeparator
    221223        // @formatter:on
    222224    }
  • trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java

    r9273 r10378  
    2424 * @since 5793
    2525 */
    26 public class EditRelationAction extends AbstractRelationAction  {
     26public class EditRelationAction extends AbstractRelationAction {
    2727
    2828    /**
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r10308 r10378  
    6868    private final boolean caseSensitive;
    6969    private final boolean regexSearch;
    70     private static String  rxErrorMsg = marktr("The regex \"{0}\" had a parse error at offset {1}, full error:\n\n{2}");
    71     private static String  rxErrorMsgNoPos = marktr("The regex \"{0}\" had a parse error, full error:\n\n{1}");
     70    private static String rxErrorMsg = marktr("The regex \"{0}\" had a parse error at offset {1}, full error:\n\n{2}");
     71    private static String rxErrorMsgNoPos = marktr("The regex \"{0}\" had a parse error, full error:\n\n{1}");
    7272    private final PushbackTokenizer tokenizer;
    7373    private static Map<String, SimpleMatchFactory> simpleMatchFactoryMap = new HashMap<>();
  • trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java

    r9067 r10378  
    3636     */
    3737    public FixDataHook() {
     38        // CHECKSTYLE.OFF: SingleSpaceSeparator
    3839        deprecated.add(new FixDataSpace());
    3940        deprecated.add(new FixDataKey("color",            "colour"));
     
    4445        deprecated.add(new FixDataTag("oneway",  "1",     "oneway",  "yes"));
    4546        deprecated.add(new FixDataTag("highway", "stile", "barrier", "stile"));
     47        // CHECKSTYLE.ON: SingleSpaceSeparator
    4648        deprecated.add(new FixData() {
    4749            @Override
Note: See TracChangeset for help on using the changeset viewer.