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

Checkstyle 6.19: enable SingleSpaceSeparator and fix violations

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
13 edited

Legend:

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

    r9796 r10378  
    3737    public static ColorScale createCyclicScale(int count) {
    3838        ColorScale sc = new ColorScale();
    39         //                    red   yellow  green   blue    red
    40         int[] h = new int[] {0,    59,     127,    244,    360};
     39        // CHECKSTYLE.OFF: SingleSpaceSeparator
     40        //                   red  yellow  green   blue    red
     41        int[] h = new int[] {0,    59,     127,    244,   360};
    4142        int[] s = new int[] {100,  84,     99,     100};
    4243        int[] b = new int[] {90,   93,     74,     83};
     44        // CHECKSTYLE.ON: SingleSpaceSeparator
    4345
    4446        sc.colors = new Color[count];
     
    166168        for (int i = 0; i <= intervalCount; i++) {
    167169            g.setColor(colors[(int) (1.0*i*n/intervalCount-1e-10)]);
    168             final double val =  min+i*(max-min)/intervalCount;
     170            final double val = min+i*(max-min)/intervalCount;
    169171            final String txt = String.format("%.3f", val*valueScale);
    170172            if (w < h) {
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r10308 r10378  
    327327    static class ReverseScript implements ScriptBuilder {
    328328        @Override
    329         public  Change build_script(
     329        public Change build_script(
    330330                final boolean[] changed0, int len0,
    331331                final boolean[] changed1, int len1) {
     
    828828        private final int bufferedLines;
    829829
    830         /** Vector, indexed by line number, containing an equivalence code for
    831            each line.  It is this vector that is actually compared with that
    832            of another file to generate differences. */
    833         private final int[]     equivs;
    834 
    835         /** Vector, like the previous one except that
    836            the elements for discarded lines have been squeezed out.  */
    837         private final int[]    undiscarded;
    838 
    839         /** Vector mapping virtual line numbers (not counting discarded lines)
    840            to real ones (counting those lines).  Both are origin-0.  */
    841         private final int[]    realindexes;
     830        /** Vector, indexed by line number, containing an equivalence code for each line.
     831         * It is this vector that is actually compared with that of another file to generate differences. */
     832        private final int[] equivs;
     833
     834        /** Vector, like the previous one except that the elements for discarded lines have been squeezed out. */
     835        private final int[] undiscarded;
     836
     837        /** Vector mapping virtual line numbers (not counting discarded lines) to real ones (counting those lines).
     838         * Both are origin-0.  */
     839        private final int[] realindexes;
    842840
    843841        /** Total number of nondiscarded lines. */
    844         private int         nondiscardedLines;
    845 
    846         /** Array, indexed by real origin-1 line number,
    847            containing true for a line that is an insertion or a deletion.
    848            The results of comparison are stored here.  */
    849         private boolean[]       changedFlag;
     842        private int nondiscardedLines;
     843
     844        /** Array, indexed by real origin-1 line number, containing true for a line that is an insertion or a deletion.
     845           The results of comparison are stored here. */
     846        private boolean[] changedFlag;
    850847    }
    851848}
  • trunk/src/org/openstreetmap/josm/tools/ExifReader.java

    r10212 r10378  
    179179    }
    180180
    181     private static double readAxis(GpsDirectory dirGps, int gpsTag, int gpsTagRef, char cRef) throws MetadataException  {
     181    private static double readAxis(GpsDirectory dirGps, int gpsTag, int gpsTagRef, char cRef) throws MetadataException {
    182182        double value;
    183183        Rational[] components = dirGps.getRationalArray(gpsTag);
     
    205205     * Returns a Transform that fixes the image orientation.
    206206     *
    207      * Only orientation 1, 3, 6 and 8 are supported. Everything else is treated
    208      * as 1.
     207     * Only orientation 1, 3, 6 and 8 are supported. Everything else is treated as 1.
    209208     * @param orientation the exif-orientation of the image
    210209     * @param width the original width of the image
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r9952 r10378  
    789789
    790790        BigDecimal d = new BigDecimal(3, MathContext.DECIMAL128); // 1/2 * 6 = 3
    791         area  = area.multiply(d, MathContext.DECIMAL128);
     791        area = area.multiply(d, MathContext.DECIMAL128);
    792792        if (area.compareTo(BigDecimal.ZERO) != 0) {
    793793            north = north.divide(area, MathContext.DECIMAL128);
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r10362 r10378  
    102102public class ImageProvider {
    103103
     104    // CHECKSTYLE.OFF: SingleSpaceSeparator
    104105    private static final String HTTP_PROTOCOL  = "http://";
    105106    private static final String HTTPS_PROTOCOL = "https://";
    106107    private static final String WIKI_PROTOCOL  = "wiki://";
     108    // CHECKSTYLE.ON: SingleSpaceSeparator
    107109
    108110    /**
  • trunk/src/org/openstreetmap/josm/tools/MultikeyShortcutAction.java

    r8674 r10378  
    2727                return '0';
    2828            else
    29                 return (char) ('A' +  index - 10);
     29                return (char) ('A' + index - 10);
    3030        }
    3131
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r10308 r10378  
    232232    public static String getPackageDetails(String ... packageNames) {
    233233        try {
     234            // CHECKSTYLE.OFF: SingleSpaceSeparator
    234235            boolean dpkg = Files.exists(Paths.get("/usr/bin/dpkg-query"));
    235236            boolean eque = Files.exists(Paths.get("/usr/bin/equery"));
    236237            boolean rpm  = Files.exists(Paths.get("/bin/rpm"));
     238            // CHECKSTYLE.ON: SingleSpaceSeparator
    237239            if (dpkg || rpm || eque) {
    238240                for (String packageName : packageNames) {
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r10337 r10378  
    7979        (byte) 0xfc, (byte) 0xf1, 0x7f, 0x73, (byte) 0xa7, (byte) 0x9d, (byte) 0xde, (byte) 0xc7, (byte) 0x88, 0x57, 0x51,
    8080        (byte) 0x84, (byte) 0xed, (byte) 0x96, (byte) 0xfb, (byte) 0xe1, 0x38, (byte) 0xef, 0x08, 0x2b, (byte) 0xf3,
    81         (byte) 0xc7, (byte) 0xc3,  0x5d, (byte) 0xfe, (byte) 0xf9, 0x51, (byte) 0xe6, 0x29, (byte) 0xfc, (byte) 0xe5, 0x0d,
     81        (byte) 0xc7, (byte) 0xc3, 0x5d, (byte) 0xfe, (byte) 0xf9, 0x51, (byte) 0xe6, 0x29, (byte) 0xfc, (byte) 0xe5, 0x0d,
    8282        (byte) 0xa1, 0x0d, (byte) 0xa8, (byte) 0xb4, (byte) 0xae, 0x26, 0x18, 0x19, 0x4d, 0x6c, 0x0c, 0x3b, 0x12, (byte) 0xba,
    8383        (byte) 0xbc, 0x5f, 0x32, (byte) 0xb3, (byte) 0xbe, (byte) 0x9d, 0x17, 0x0d, 0x4d, 0x2f, 0x1a, 0x48, (byte) 0xb7,
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r10339 r10378  
    221221     */
    222222    public void setMnemonic(AbstractButton button) {
    223         if (assignedModifier == getGroupModifier(MNEMONIC)  && getKeyStroke() != null && KeyEvent.getKeyText(assignedKey).length() == 1) {
     223        if (assignedModifier == getGroupModifier(MNEMONIC) && getKeyStroke() != null && KeyEvent.getKeyText(assignedKey).length() == 1) {
    224224            button.setMnemonic(KeyEvent.getKeyText(assignedKey).charAt(0)); //getKeyStroke().getKeyChar() seems not to work here
    225225        }
     
    231231     */
    232232    public void setFocusAccelerator(JTextComponent component) {
    233         if (assignedModifier == getGroupModifier(MNEMONIC)  && getKeyStroke() != null && KeyEvent.getKeyText(assignedKey).length() == 1) {
     233        if (assignedModifier == getGroupModifier(MNEMONIC) && getKeyStroke() != null && KeyEvent.getKeyText(assignedKey).length() == 1) {
    234234            component.setFocusAccelerator(KeyEvent.getKeyText(assignedKey).charAt(0));
    235235        }
  • trunk/src/org/openstreetmap/josm/tools/TextTagParser.java

    r10308 r10378  
    125125            while (pos < n) {
    126126                c = data.charAt(pos);
    127                 if (c == '\t' || c == '\n'  || c == ' ') {
     127                if (c == '\t' || c == '\n' || c == ' ') {
    128128                    pos++;
    129129                } else if (c == '=') {
     
    177177         String k;
    178178         String v;
    179          for (String  line: lines) {
     179         for (String line: lines) {
    180180            if (line.trim().isEmpty()) continue; // skip empty lines
    181181            Matcher m = p.matcher(line);
     
    195195         if (!tags.isEmpty()) {
    196196            return tags;
    197          }  else {
     197         } else {
    198198            return null;
    199199         }
  • trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java

    r10242 r10378  
    5858     * @param window the window
    5959     */
    60     public WindowGeometry(Window window)  {
     60    public WindowGeometry(Window window) {
    6161        this(window.getLocationOnScreen(), window.getSize());
    6262    }
     
    165165     * @param window the window
    166166     */
    167     public void fixScreen(Window window)  {
     167    public void fixScreen(Window window) {
    168168        Rectangle oldScreen = getScreenInfo(getRectangle());
    169169        Rectangle newScreen = getScreenInfo(new Rectangle(window.getLocationOnScreen(), window.getSize()));
     
    402402            Rectangle bounds = gc.getBounds();
    403403            Insets insets = component.getToolkit().getScreenInsets(gc);
    404             result.width  = bounds.width - insets.left - insets.right;
     404            result.width = bounds.width - insets.left - insets.right;
    405405            result.height = bounds.height - insets.top - insets.bottom;
    406406        }
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r10212 r10378  
    106106            } else if (mapping.containsKey(qname) && characters != null && !current.isEmpty()) {
    107107                setValue(mapping.get(qname), qname, characters.toString().trim());
    108                 characters  = new StringBuilder(64);
     108                characters = new StringBuilder(64);
    109109            }
    110110        }
     
    117117        private void report() {
    118118            queue.add(current.pop());
    119             characters  = new StringBuilder(64);
     119            characters = new StringBuilder(64);
    120120        }
    121121
  • trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java

    r8926 r10378  
    108108
    109109            Token token = tokenizer.lookAhead();
    110             if (token.getType()  == TokenType.END) {
     110            if (token.getType() == TokenType.END) {
    111111                tokenizer.nextToken();
    112112                return result;
Note: See TracChangeset for help on using the changeset viewer.