Ignore:
Timestamp:
2014-02-01T03:18:43+01:00 (6 years ago)
Author:
Don-vip
Message:

fix some Sonar issues

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

Legend:

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

    r6380 r6798  
    5555        } else if (dir == Direction.LEFT)  {
    5656            sc = Shortcut.registerShortcut("core:moveleft",  tr("Move objects {0}", tr("left")), KeyEvent.VK_LEFT,  Shortcut.SHIFT);
    57         } else { //dir == Direction.RIGHT) {
     57        } else { //dir == Direction.RIGHT
    5858            sc = Shortcut.registerShortcut("core:moveright", tr("Move objects {0}", tr("right")), KeyEvent.VK_RIGHT, Shortcut.SHIFT);
    5959        }
     
    7373        } else if (dir == Direction.LEFT)  {
    7474            putValue("toolbar", "action/move/left");
    75         } else { //dir == Direction.RIGHT) {
     75        } else { //dir == Direction.RIGHT
    7676            putValue("toolbar", "action/move/right");
    7777        }
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r6317 r6798  
    4141 */
    4242public final class OrthogonalizeAction extends JosmAction {
    43     private String USAGE = tr(
     43    private static final String USAGE = tr(
    4444            "<h3>When one or more ways are selected, the shape is adjusted such, that all angles are 90 or 180 degrees.</h3>"+
    4545            "You can add two nodes to the selection. Then, the direction is fixed by these two reference nodes. "+
     
    279279            throw new InvalidUserInputException(
    280280                    tr("<html>Please make sure all selected ways head in a similar direction<br>"+
    281                     "or orthogonalize them one by one.</html>"));
     281                    "or orthogonalize them one by one.</html>"), ex);
    282282        }
    283283
     
    439439                    direction = direction.changeBy(angleToDirectionChange(h2 - h1, TOLERANCE1));
    440440                } catch (RejectedAngleException ex) {
    441                     throw new InvalidUserInputException(tr("Please select ways with angles of approximately 90 or 180 degrees."));
     441                    throw new InvalidUserInputException(tr("Please select ways with angles of approximately 90 or 180 degrees."), ex);
    442442                }
    443443                segDirections[i+1] = direction;
     
    574574            super(message);
    575575        }
     576        InvalidUserInputException(String message, Throwable cause) {
     577            super(message, cause);
     578        }
    576579        InvalidUserInputException() {
    577580            super();
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java

    r6380 r6798  
    1919public class DownloadOsmCompressedTask extends DownloadOsmTask {
    2020
    21     String PATTERN_GZ =  "https?://.*/.*\\.osm.(gz|bz2?)";
     21    static final String PATTERN_GZ =  "https?://.*/.*\\.osm.(gz|bz2?)";
    2222
    2323    @Override
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r6792 r6798  
    8686
    8787    private Node lastUsedNode = null;
    88     private double PHI=Math.toRadians(90);
     88    private static final double PHI = Math.toRadians(90);
    8989    private double toleranceMultiplier;
    9090
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r6792 r6798  
    445445                    this.keyPattern = Pattern.compile(key, searchFlags);
    446446                } catch (PatternSyntaxException e) {
    447                     throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
     447                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);
    448448                } catch (Exception e) {
    449                     throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage()));
     449                    throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage()), e);
    450450                }
    451451                try {
    452452                    this.valuePattern = Pattern.compile(value, searchFlags);
    453453                } catch (PatternSyntaxException e) {
    454                     throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
     454                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);
    455455                } catch (Exception e) {
    456                     throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage()));
     456                    throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage()), e);
    457457                }
    458458                this.key = key;
     
    696696                    this.searchRegex = Pattern.compile(s, regexFlags(caseSensitive));
    697697                } catch (PatternSyntaxException e) {
    698                     throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()));
     698                    throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);
    699699                } catch (Exception e) {
    700                     throw new ParseError(tr(rxErrorMsgNoPos, s, e.getMessage()));
     700                    throw new ParseError(tr(rxErrorMsgNoPos, s, e.getMessage()), e);
    701701                }
    702702                this.search = s;
     
    11711171        public ParseError(String msg) {
    11721172            super(msg);
     1173        }
     1174        public ParseError(String msg, Throwable cause) {
     1175            super(msg, cause);
    11731176        }
    11741177        public ParseError(Token expected, Token found) {
Note: See TracChangeset for help on using the changeset viewer.