Ticket #8902: arrays.diff

File arrays.diff, 18.5 KB (added by shinigami, 11 years ago)

c-like array definitions changed to java-like (int a[] -> int[] a)

  • src/org/openstreetmap/josm/actions/ZoomToAction.java

     
    6464    public void actionPerformed(ActionEvent e) {
    6565        if (! isEnabled())
    6666            return;
    67         int rows[] = this.table.getSelectedRows();
     67        int[] rows = this.table.getSelectedRows();
    6868        if (rows == null || rows.length == 0)
    6969            return;
    7070        int row = rows[0];
  • src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java

     
    5252        StringBuilder buf = new StringBuilder("<tr><td>");
    5353        buf.append(getTitle());
    5454        buf.append(":</td><td>");
    55         String patterns[] = getPatterns();
     55        String[] patterns = getPatterns();
    5656        if (patterns.length>0) {
    5757            buf.append("<ul>");
    5858            for (String pattern: patterns) {
  • src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

     
    13321332        private EastNorth segmentPoint2; // remembered second point of base segment
    13331333        private EastNorth projectionSource; // point that we are projecting to the line
    13341334
    1335         double snapAngles[];
     1335        double[] snapAngles;
    13361336        double snapAngleTolerance;
    13371337
    13381338        double pe,pn; // (pe,pn) - direction of snapping line
  • src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java

     
    8181        composition of some (not necessarily all) name:* labels.
    8282        Check if this is the case. */
    8383
    84         String split_names[] = name.split(" - ");
     84        String[] split_names = name.split(" - ");
    8585        if (split_names.length == 1) {
    8686            /* The name is not composed of multiple parts. Complain. */
    8787            missingTranslation(p);
  • src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java

     
    9898     * @return The distance between words
    9999     */
    100100    public int getLevenshteinDistance(String s, String t) {
    101         int d[][]; // matrix
     101        int[][] d; // matrix
    102102        int n; // length of s
    103103        int m; // length of t
    104104        int i; // iterates through s
  • src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java

     
    281281
    282282        @Override
    283283        public void actionPerformed(ActionEvent arg0) {
    284             int rows[] = mineTable.getSelectedRows();
     284            int[] rows = mineTable.getSelectedRows();
    285285            if (rows == null || rows.length == 0)
    286286                return;
    287287            model.decide(rows, MergeDecisionType.KEEP_MINE);
     
    313313
    314314        @Override
    315315        public void actionPerformed(ActionEvent arg0) {
    316             int rows[] = theirTable.getSelectedRows();
     316            int[] rows = theirTable.getSelectedRows();
    317317            if (rows == null || rows.length == 0)
    318318                return;
    319319            model.decide(rows, MergeDecisionType.KEEP_THEIR);
     
    411411
    412412        @Override
    413413        public void actionPerformed(ActionEvent arg0) {
    414             int rows[] = mergedTable.getSelectedRows();
     414            int[] rows = mergedTable.getSelectedRows();
    415415            if (rows == null || rows.length == 0)
    416416                return;
    417417            model.decide(rows, MergeDecisionType.UNDECIDED);
  • src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

     
    389389     * @param visible true, if the components should be visible; false otherwise
    390390     */
    391391    protected void setContentVisible(boolean visible) {
    392         Component comps[] = getComponents();
     392        Component[] comps = getComponents();
    393393        for(int i=0; i<comps.length; i++) {
    394394            if (comps[i] != titleBar && (!visible || comps[i] != buttonsPanel || buttonHiding != ButtonHiddingType.ALWAYS_HIDDEN)) {
    395395                comps[i].setVisible(visible);
  • src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

     
    162162        }
    163163
    164164        public void select() {
    165             int indexes[] = userTable.getSelectedRows();
     165            int[] indexes = userTable.getSelectedRows();
    166166            if (indexes == null || indexes.length == 0) return;
    167167            model.selectPrimitivesOwnedBy(userTable.getSelectedRows());
    168168        }
     
    197197
    198198        @Override
    199199        public void actionPerformed(ActionEvent e) {
    200             int rows[] = userTable.getSelectedRows();
     200            int[] rows = userTable.getSelectedRows();
    201201            if (rows == null || rows.length == 0) return;
    202202            List<User> users = model.getSelectedUsers(rows);
    203203            if (users.isEmpty()) return;
     
    363363            Main.main.getCurrentDataSet().setSelected(byUser);
    364364        }
    365365
    366         public List<User> getSelectedUsers(int rows[]) {
     366        public List<User> getSelectedUsers(int[] rows) {
    367367            LinkedList<User> ret = new LinkedList<User>();
    368368            if (rows == null || rows.length == 0) return ret;
    369369            for (int row: rows) {
  • src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

     
    11351135
    11361136        @Override
    11371137        public void actionPerformed(ActionEvent ae) {
    1138             int rows[] = propertyTable.getSelectedRows();
     1138            int[] rows = propertyTable.getSelectedRows();
    11391139            Set<String> values = new TreeSet<String>();
    11401140            Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected();
    11411141            if (rows.length == 0 || sel.isEmpty()) return;
  • src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java

     
    129129            setDotted(g);
    130130            y1 = 7;
    131131
    132             int xValues [] = {xoff - xowloop + 1, xoff - xowloop + 1, xoff};
    133             int yValues [] = {ymax, y1+1, 1};
     132            int[] xValues = {xoff - xowloop + 1, xoff - xowloop + 1, xoff};
     133            int[] yValues = {ymax, y1+1, 1};
    134134            g.drawPolyline(xValues, yValues, 3);
    135135            unsetDotted(g);
    136136            g.drawLine(xoff + xowloop, y1+1, xoff, 1);
     
    140140            setDotted(g);
    141141            y2 = ymax - 7;
    142142
    143             int xValues [] = {xoff+1, xoff - xowloop + 1, xoff - xowloop + 1};
    144             int yValues [] = {ymax-1, y2, y1};
     143            int[] xValues = {xoff+1, xoff - xowloop + 1, xoff - xowloop + 1};
     144            int[] yValues = {ymax-1, y2, y1};
    145145            g.drawPolyline(xValues, yValues, 3);
    146146            unsetDotted(g);
    147147            g.drawLine(xoff + xowloop, y2, xoff, ymax-1);
  • src/org/openstreetmap/josm/gui/layer/GpxLayer.java

     
    534534            }
    535535            double now = new Date().getTime()/1000.0;
    536536            if (colored == colorModes.time) {
    537                 Date bounds[] = getMinMaxTimeForAllTracks();
     537                Date[] bounds = getMinMaxTimeForAllTracks();
    538538                if (bounds!=null) {
    539539                    minval = bounds[0].getTime()/1000.0;
    540540                    maxval = bounds[1].getTime()/1000.0;
  • src/org/openstreetmap/josm/gui/layer/TMSLayer.java

     
    13611361        g.setColor(Color.DARK_GRAY);
    13621362
    13631363        List<Tile> missedTiles = this.paintTileImages(g, ts, displayZoomLevel, null);
    1364         int otherZooms[] = { -1, 1, -2, 2, -3, -4, -5};
     1364        int[] otherZooms = { -1, 1, -2, 2, -3, -4, -5};
    13651365        for (int zoomOffset : otherZooms) {
    13661366            if (!autoZoom) {
    13671367                break;
  • src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java

     
    3737    private final JCheckBox cbDownloadGpxData;
    3838
    3939    // Legacy list of values
    40     private static final Integer dist[] = { 5000, 500, 50 };
    41     private static final Integer area[] = { 20, 10, 5, 1 };
     40    private static final Integer[] dist = { 5000, 500, 50 };
     41    private static final Integer[] area = { 20, 10, 5, 1 };
    4242   
    4343    private final JList buffer;
    4444    private final JList maxRect;
     
    6969        add(cbDownloadGpxData,  GBC.eol().insets(5,5,1,5));
    7070       
    7171        add(new JLabel(tr("Download everything within:")), GBC.eol());
    72         String s[] = new String[dist.length];
     72        String[] s = new String[dist.length];
    7373        for (int i = 0; i < dist.length; ++i) {
    7474            s[i] = tr("{0} meters", dist[i]);
    7575        }
  • src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java

     
    293293        }
    294294    }
    295295
    296     @Override public void characters(char ch[], int start, int length)
     296    @Override public void characters(char[] ch, int start, int length)
    297297    {
    298298        if (inScaleMax == true) {
    299299            rule.scaleMax = Long.parseLong(new String(ch, start, length));
  • src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

     
    191191        };
    192192        JFileChooser fc = DiskAccessAction.createAndOpenFileChooser(!saveFileFlag, !saveFileFlag, title, filter, JFileChooser.FILES_ONLY, "customsettings.lastDirectory");
    193193        if (fc != null) {
    194             File sel[] = fc.isMultiSelectionEnabled() ? fc.getSelectedFiles() : (new File[]{fc.getSelectedFile()});
     194            File[] sel = fc.isMultiSelectionEnabled() ? fc.getSelectedFiles() : (new File[]{fc.getSelectedFile()});
    195195            if (sel.length==1 && !sel[0].getName().contains(".")) sel[0]=new File(sel[0].getAbsolutePath()+".xml");
    196196            return sel;
    197197        }
     
    407407            Setting valueSetting = e.getValue();
    408408            String prefValue = valueSetting.getValue() == null ? "" : valueSetting.getValue().toString();
    409409
    410             String input[] = txtFilter.getText().split("\\s+");
     410            String[] input = txtFilter.getText().split("\\s+");
    411411            boolean canHas = true;
    412412
    413413            // Make 'wmsplugin cache' search for e.g. 'cache.wmsplugin'
  • src/org/openstreetmap/josm/gui/util/GuiHelper.java

     
    187187            w = 1.0f;
    188188        }
    189189        if (s.length>1) {
    190             float dash[]= new float[s.length-1];
     190            float[] dash= new float[s.length-1];
    191191            boolean error = false;
    192192            float sumAbs = 0;
    193193            try {
  • src/org/openstreetmap/josm/io/UTFInputStreamReader.java

     
    1717     * @return A reader with the correct encoding. Starts to read after the BOM.
    1818     */
    1919    public static UTFInputStreamReader create(InputStream input, String defaultEncoding) throws IOException {
    20         byte bom[] = new byte[4];
     20        byte[] bom = new byte[4];
    2121        String encoding = defaultEncoding;
    2222        int unread;
    2323        PushbackInputStream pushbackStream = new PushbackInputStream(input, 4);
  • src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

     
    132132
    133133
    134134        final DefaultTableModel tm = new DefaultTableModel(new String[] {tr("Assume"), tr("Key"), tr("Value"), tr("Existing values")}, tags.length) {
    135             final Class<?> types[] = {Boolean.class, String.class, Object.class, ExistingValues.class};
     135            final Class<?>[] types = {Boolean.class, String.class, Object.class, ExistingValues.class};
    136136            @Override
    137137            public Class getColumnClass(int c) {
    138138                return types[c];
  • src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

     
    173173                get=in.readLine();
    174174                if (get==null) break;
    175175                k++;
    176                 String h[] = get.split(": ", 2);
     176                String[] h = get.split(": ", 2);
    177177                if (h.length==2) {
    178178                    headers.put(h[0], h[1]);
    179179                } else break;
  • src/org/openstreetmap/josm/plugins/PluginInformation.java

     
    441441     */
    442442    public boolean matches(String filter) {
    443443        if (filter == null) return true;
    444         String words[] = filter.split("\\s+");
     444        String[] words = filter.split("\\s+");
    445445        for (String word: words) {
    446446            if (matches(word, name)
    447447                    || matches(word, description)
  • src/org/openstreetmap/josm/plugins/PluginListParser.java

     
    8484                    continue;
    8585                }
    8686                addPluginInformation(ret, name, url, manifest.toString());
    87                 String x[] = line.split(";");
     87                String[] x = line.split(";");
    8888                if(x.length != 2)
    8989                    throw new IOException(tr("Illegal entry in plugin list."));
    9090                name = x[0];
  • src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

     
    4040
    4141        try {
    4242            if (map.containsKey("bbox")) {
    43                 String bbox[] = map.get("bbox").split(",");
     43                String[] bbox = map.get("bbox").split(",");
    4444                b = new Bounds(
    4545                        new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[0])),
    4646                        new LatLon(Double.parseDouble(bbox[3]), Double.parseDouble(bbox[2])));
  • src/org/openstreetmap/josm/tools/TextTagParser.java

     
    7070        }
    7171       
    7272        private String parseString(String stopChars) {
    73             char stop[] = stopChars.toCharArray();
     73            char[] stop = stopChars.toCharArray();
    7474            Arrays.sort(stop);
    7575            char c;
    7676            while (pos < n) {
     
    158158     * @param unescapeTextInQuotes - if true, matched tag and value will be analyzed more thoroughly
    159159     */
    160160    public static Map<String, String> readTagsByRegexp(String text, String splitRegex, String tagRegex, boolean unescapeTextInQuotes) {
    161          String lines[] = text.split(splitRegex);
     161         String[] lines = text.split(splitRegex);
    162162         Pattern p = Pattern.compile(tagRegex);
    163163         Map<String, String> tags = new HashMap<String,String>();
    164164         String k=null, v=null;