Ticket #8902: arrays.diff
File arrays.diff, 18.5 KB (added by , 11 years ago) |
---|
-
src/org/openstreetmap/josm/actions/ZoomToAction.java
64 64 public void actionPerformed(ActionEvent e) { 65 65 if (! isEnabled()) 66 66 return; 67 int rows[]= this.table.getSelectedRows();67 int[] rows = this.table.getSelectedRows(); 68 68 if (rows == null || rows.length == 0) 69 69 return; 70 70 int row = rows[0]; -
src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java
52 52 StringBuilder buf = new StringBuilder("<tr><td>"); 53 53 buf.append(getTitle()); 54 54 buf.append(":</td><td>"); 55 String patterns[]= getPatterns();55 String[] patterns = getPatterns(); 56 56 if (patterns.length>0) { 57 57 buf.append("<ul>"); 58 58 for (String pattern: patterns) { -
src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
1332 1332 private EastNorth segmentPoint2; // remembered second point of base segment 1333 1333 private EastNorth projectionSource; // point that we are projecting to the line 1334 1334 1335 double snapAngles[];1335 double[] snapAngles; 1336 1336 double snapAngleTolerance; 1337 1337 1338 1338 double pe,pn; // (pe,pn) - direction of snapping line -
src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java
81 81 composition of some (not necessarily all) name:* labels. 82 82 Check if this is the case. */ 83 83 84 String split_names[]= name.split(" - ");84 String[] split_names = name.split(" - "); 85 85 if (split_names.length == 1) { 86 86 /* The name is not composed of multiple parts. Complain. */ 87 87 missingTranslation(p); -
src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
98 98 * @return The distance between words 99 99 */ 100 100 public int getLevenshteinDistance(String s, String t) { 101 int d[][]; // matrix101 int[][] d; // matrix 102 102 int n; // length of s 103 103 int m; // length of t 104 104 int i; // iterates through s -
src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java
281 281 282 282 @Override 283 283 public void actionPerformed(ActionEvent arg0) { 284 int rows[]= mineTable.getSelectedRows();284 int[] rows = mineTable.getSelectedRows(); 285 285 if (rows == null || rows.length == 0) 286 286 return; 287 287 model.decide(rows, MergeDecisionType.KEEP_MINE); … … 313 313 314 314 @Override 315 315 public void actionPerformed(ActionEvent arg0) { 316 int rows[]= theirTable.getSelectedRows();316 int[] rows = theirTable.getSelectedRows(); 317 317 if (rows == null || rows.length == 0) 318 318 return; 319 319 model.decide(rows, MergeDecisionType.KEEP_THEIR); … … 411 411 412 412 @Override 413 413 public void actionPerformed(ActionEvent arg0) { 414 int rows[]= mergedTable.getSelectedRows();414 int[] rows = mergedTable.getSelectedRows(); 415 415 if (rows == null || rows.length == 0) 416 416 return; 417 417 model.decide(rows, MergeDecisionType.UNDECIDED); -
src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
389 389 * @param visible true, if the components should be visible; false otherwise 390 390 */ 391 391 protected void setContentVisible(boolean visible) { 392 Component comps[]= getComponents();392 Component[] comps = getComponents(); 393 393 for(int i=0; i<comps.length; i++) { 394 394 if (comps[i] != titleBar && (!visible || comps[i] != buttonsPanel || buttonHiding != ButtonHiddingType.ALWAYS_HIDDEN)) { 395 395 comps[i].setVisible(visible); -
src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
162 162 } 163 163 164 164 public void select() { 165 int indexes[]= userTable.getSelectedRows();165 int[] indexes = userTable.getSelectedRows(); 166 166 if (indexes == null || indexes.length == 0) return; 167 167 model.selectPrimitivesOwnedBy(userTable.getSelectedRows()); 168 168 } … … 197 197 198 198 @Override 199 199 public void actionPerformed(ActionEvent e) { 200 int rows[]= userTable.getSelectedRows();200 int[] rows = userTable.getSelectedRows(); 201 201 if (rows == null || rows.length == 0) return; 202 202 List<User> users = model.getSelectedUsers(rows); 203 203 if (users.isEmpty()) return; … … 363 363 Main.main.getCurrentDataSet().setSelected(byUser); 364 364 } 365 365 366 public List<User> getSelectedUsers(int rows[]) {366 public List<User> getSelectedUsers(int[] rows) { 367 367 LinkedList<User> ret = new LinkedList<User>(); 368 368 if (rows == null || rows.length == 0) return ret; 369 369 for (int row: rows) { -
src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
1135 1135 1136 1136 @Override 1137 1137 public void actionPerformed(ActionEvent ae) { 1138 int rows[]= propertyTable.getSelectedRows();1138 int[] rows = propertyTable.getSelectedRows(); 1139 1139 Set<String> values = new TreeSet<String>(); 1140 1140 Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected(); 1141 1141 if (rows.length == 0 || sel.isEmpty()) return; -
src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java
129 129 setDotted(g); 130 130 y1 = 7; 131 131 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}; 134 134 g.drawPolyline(xValues, yValues, 3); 135 135 unsetDotted(g); 136 136 g.drawLine(xoff + xowloop, y1+1, xoff, 1); … … 140 140 setDotted(g); 141 141 y2 = ymax - 7; 142 142 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}; 145 145 g.drawPolyline(xValues, yValues, 3); 146 146 unsetDotted(g); 147 147 g.drawLine(xoff + xowloop, y2, xoff, ymax-1); -
src/org/openstreetmap/josm/gui/layer/GpxLayer.java
534 534 } 535 535 double now = new Date().getTime()/1000.0; 536 536 if (colored == colorModes.time) { 537 Date bounds[]= getMinMaxTimeForAllTracks();537 Date[] bounds = getMinMaxTimeForAllTracks(); 538 538 if (bounds!=null) { 539 539 minval = bounds[0].getTime()/1000.0; 540 540 maxval = bounds[1].getTime()/1000.0; -
src/org/openstreetmap/josm/gui/layer/TMSLayer.java
1361 1361 g.setColor(Color.DARK_GRAY); 1362 1362 1363 1363 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}; 1365 1365 for (int zoomOffset : otherZooms) { 1366 1366 if (!autoZoom) { 1367 1367 break; -
src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java
37 37 private final JCheckBox cbDownloadGpxData; 38 38 39 39 // 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 }; 42 42 43 43 private final JList buffer; 44 44 private final JList maxRect; … … 69 69 add(cbDownloadGpxData, GBC.eol().insets(5,5,1,5)); 70 70 71 71 add(new JLabel(tr("Download everything within:")), GBC.eol()); 72 String s[]= new String[dist.length];72 String[] s = new String[dist.length]; 73 73 for (int i = 0; i < dist.length; ++i) { 74 74 s[i] = tr("{0} meters", dist[i]); 75 75 } -
src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java
293 293 } 294 294 } 295 295 296 @Override public void characters(char ch[], int start, int length)296 @Override public void characters(char[] ch, int start, int length) 297 297 { 298 298 if (inScaleMax == true) { 299 299 rule.scaleMax = Long.parseLong(new String(ch, start, length)); -
src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
191 191 }; 192 192 JFileChooser fc = DiskAccessAction.createAndOpenFileChooser(!saveFileFlag, !saveFileFlag, title, filter, JFileChooser.FILES_ONLY, "customsettings.lastDirectory"); 193 193 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()}); 195 195 if (sel.length==1 && !sel[0].getName().contains(".")) sel[0]=new File(sel[0].getAbsolutePath()+".xml"); 196 196 return sel; 197 197 } … … 407 407 Setting valueSetting = e.getValue(); 408 408 String prefValue = valueSetting.getValue() == null ? "" : valueSetting.getValue().toString(); 409 409 410 String input[]= txtFilter.getText().split("\\s+");410 String[] input = txtFilter.getText().split("\\s+"); 411 411 boolean canHas = true; 412 412 413 413 // Make 'wmsplugin cache' search for e.g. 'cache.wmsplugin' -
src/org/openstreetmap/josm/gui/util/GuiHelper.java
187 187 w = 1.0f; 188 188 } 189 189 if (s.length>1) { 190 float dash[]= new float[s.length-1];190 float[] dash= new float[s.length-1]; 191 191 boolean error = false; 192 192 float sumAbs = 0; 193 193 try { -
src/org/openstreetmap/josm/io/UTFInputStreamReader.java
17 17 * @return A reader with the correct encoding. Starts to read after the BOM. 18 18 */ 19 19 public static UTFInputStreamReader create(InputStream input, String defaultEncoding) throws IOException { 20 byte bom[]= new byte[4];20 byte[] bom = new byte[4]; 21 21 String encoding = defaultEncoding; 22 22 int unread; 23 23 PushbackInputStream pushbackStream = new PushbackInputStream(input, 4); -
src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
132 132 133 133 134 134 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}; 136 136 @Override 137 137 public Class getColumnClass(int c) { 138 138 return types[c]; -
src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
173 173 get=in.readLine(); 174 174 if (get==null) break; 175 175 k++; 176 String h[]= get.split(": ", 2);176 String[] h = get.split(": ", 2); 177 177 if (h.length==2) { 178 178 headers.put(h[0], h[1]); 179 179 } else break; -
src/org/openstreetmap/josm/plugins/PluginInformation.java
441 441 */ 442 442 public boolean matches(String filter) { 443 443 if (filter == null) return true; 444 String words[]= filter.split("\\s+");444 String[] words = filter.split("\\s+"); 445 445 for (String word: words) { 446 446 if (matches(word, name) 447 447 || matches(word, description) -
src/org/openstreetmap/josm/plugins/PluginListParser.java
84 84 continue; 85 85 } 86 86 addPluginInformation(ret, name, url, manifest.toString()); 87 String x[]= line.split(";");87 String[] x = line.split(";"); 88 88 if(x.length != 2) 89 89 throw new IOException(tr("Illegal entry in plugin list.")); 90 90 name = x[0]; -
src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
40 40 41 41 try { 42 42 if (map.containsKey("bbox")) { 43 String bbox[]= map.get("bbox").split(",");43 String[] bbox = map.get("bbox").split(","); 44 44 b = new Bounds( 45 45 new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[0])), 46 46 new LatLon(Double.parseDouble(bbox[3]), Double.parseDouble(bbox[2]))); -
src/org/openstreetmap/josm/tools/TextTagParser.java
70 70 } 71 71 72 72 private String parseString(String stopChars) { 73 char stop[]= stopChars.toCharArray();73 char[] stop = stopChars.toCharArray(); 74 74 Arrays.sort(stop); 75 75 char c; 76 76 while (pos < n) { … … 158 158 * @param unescapeTextInQuotes - if true, matched tag and value will be analyzed more thoroughly 159 159 */ 160 160 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); 162 162 Pattern p = Pattern.compile(tagRegex); 163 163 Map<String, String> tags = new HashMap<String,String>(); 164 164 String k=null, v=null;