Ticket #8902: warnings.diff
File warnings.diff, 24.7 KB (added by , 11 years ago) |
---|
-
src/org/openstreetmap/josm/actions/FollowLineAction.java
119 119 // from aerial imagery or GPS tracks. 120 120 if (Main.map.mapView.viewportFollowing) { 121 121 Main.map.mapView.smoothScrollTo(newPoint.getEastNorth()); 122 } ;122 } 123 123 } 124 124 } 125 125 } -
src/org/openstreetmap/josm/command/SequenceCommand.java
96 96 } 97 97 98 98 @Override 99 @SuppressWarnings("unchecked")100 99 public Collection<PseudoCommand> getChildren() { 101 return (List) Arrays.asList(sequence);100 return Arrays.<PseudoCommand>asList(sequence); 102 101 } 103 102 104 103 @Override -
src/org/openstreetmap/josm/data/CustomConfigurator.java
1084 1084 listmapMap.putAll(tmpPref.listOfStructsDefaults); 1085 1085 } 1086 1086 1087 while (stringMap.values().remove(null)) { } ;1088 while (listMap.values().remove(null)) { } ;1089 while (listlistMap.values().remove(null)) { } ;1090 while (listmapMap.values().remove(null)) { } ;1087 while (stringMap.values().remove(null)) { } 1088 while (listMap.values().remove(null)) { } 1089 while (listlistMap.values().remove(null)) { } 1090 while (listmapMap.values().remove(null)) { } 1091 1091 1092 1092 stringMap.putAll(tmpPref.properties); 1093 1093 listMap.putAll(tmpPref.collectionProperties); -
src/org/openstreetmap/josm/data/Preferences.java
1287 1287 public void visit(MapListSetting setting) { 1288 1288 changed = putListOfStructs(key, setting.getValue()); 1289 1289 } 1290 } ;1290 } 1291 1291 PutVisitor putVisitor = new PutVisitor(); 1292 1292 value.visit(putVisitor); 1293 1293 return putVisitor.changed; … … 1668 1668 } 1669 1669 } 1670 1670 1671 public static boolean isEqual(Setting a, Settingb) {1671 public static boolean isEqual(Setting<?> a, Setting<?> b) { 1672 1672 if (a==null && b==null) return true; 1673 1673 if (a==null) return false; 1674 1674 if (b==null) return false; … … 1677 1677 if (a instanceof StringSetting) 1678 1678 return (a.getValue().equals(b.getValue())); 1679 1679 if (a instanceof ListSetting) { 1680 @SuppressWarnings("unchecked") Collection<String> aValue = (Collection ) a.getValue();1681 @SuppressWarnings("unchecked") Collection<String> bValue = (Collection ) b.getValue();1680 @SuppressWarnings("unchecked") Collection<String> aValue = (Collection<String>) a.getValue(); 1681 @SuppressWarnings("unchecked") Collection<String> bValue = (Collection<String>) b.getValue(); 1682 1682 return equalCollection(aValue, bValue); 1683 1683 } 1684 1684 if (a instanceof ListListSetting) { 1685 @SuppressWarnings("unchecked") Collection<Collection<String>> aValue = (Collection ) a.getValue();1686 @SuppressWarnings("unchecked") Collection<List<String>> bValue = (Collection ) b.getValue();1685 @SuppressWarnings("unchecked") Collection<Collection<String>> aValue = (Collection<Collection<String>>) a.getValue(); 1686 @SuppressWarnings("unchecked") Collection<List<String>> bValue = (Collection<List<String>>) b.getValue(); 1687 1687 return equalArray(aValue, bValue); 1688 1688 } 1689 1689 if (a instanceof MapListSetting) { 1690 @SuppressWarnings("unchecked") Collection<Map<String, String>> aValue = (Collection ) a.getValue();1691 @SuppressWarnings("unchecked") Collection<Map<String, String>> bValue = (Collection ) b.getValue();1690 @SuppressWarnings("unchecked") Collection<Map<String, String>> aValue = (Collection<Map<String, String>>) a.getValue(); 1691 @SuppressWarnings("unchecked") Collection<Map<String, String>> bValue = (Collection<Map<String, String>>) b.getValue(); 1692 1692 return equalListOfStructs(aValue, bValue); 1693 1693 } 1694 1694 return a.equals(b); -
src/org/openstreetmap/josm/data/gpx/IWithAttributes.java
36 36 * or {@code null} if this map contains no Collection mapping for the key 37 37 * @since 5502 38 38 */ 39 Collection getCollection(String key);39 Collection<?> getCollection(String key); 40 40 41 41 /** 42 42 * Put a key / value pair as a new attribute. -
src/org/openstreetmap/josm/data/gpx/WithAttributes.java
56 56 * @since 5502 57 57 */ 58 58 @Override 59 public Collection getCollection(String key) {59 public Collection<?> getCollection(String key) { 60 60 Object value = attr.get(key); 61 return (value instanceof Collection) ? (Collection )value : null;61 return (value instanceof Collection) ? (Collection<?>)value : null; 62 62 } 63 63 64 64 /** -
src/org/openstreetmap/josm/data/projection/CustomProjection.java
326 326 } 327 327 328 328 public Proj parseProjection(Map<String, String> parameters, Ellipsoid ellps) throws ProjectionConfigurationException { 329 String id = (String)parameters.get(Param.proj.key);329 String id = parameters.get(Param.proj.key); 330 330 if (id == null) throw new ProjectionConfigurationException(tr("Projection required (+proj=*)")); 331 331 332 332 Proj proj = Projections.getBaseProjection(id); -
src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java
23 23 public Parameters(double latitudeOrigin) { 24 24 this.latitudeOrigin = latitudeOrigin; 25 25 } 26 } ;26 } 27 27 28 28 public static class Parameters1SP extends Parameters { 29 29 public Parameters1SP(double latitudeOrigin) { -
src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
821 821 } 822 822 return noMatch; 823 823 } 824 } ;824 } 825 825 826 826 public String getData(String str) { 827 827 Matcher m = Pattern.compile(" *# *([^#]+) *$").matcher(str); -
src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
49 49 NAMED_WAYS.add( "secondary" ); 50 50 NAMED_WAYS.add( "tertiary" ); 51 51 NAMED_WAYS.add( "residential" ); 52 NAMED_WAYS.add( "pedestrian" ); ;52 NAMED_WAYS.add( "pedestrian" ); 53 53 } 54 54 55 55 /** Whitelist of roles allowed to reference an untagged way */ -
src/org/openstreetmap/josm/gui/NavigatableComponent.java
493 493 { 494 494 // fixme - not use zoom history here 495 495 zoomTo(oldCenter.interpolate(finalNewCenter, (i+1) / frames)); 496 try { Thread.sleep(1000 / fps); } catch (InterruptedException ex) { } ;496 try { Thread.sleep(1000 / fps); } catch (InterruptedException ex) { } 497 497 } 498 498 } 499 499 }.start(); -
src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
850 850 @Override public Class<?> getColumnClass(int columnIndex) { 851 851 return String.class; 852 852 } 853 } ;853 } 854 854 855 855 /** 856 856 * Action handling delete button press in properties dialog. -
src/org/openstreetmap/josm/gui/io/UpdatePrimitivesTask.java
90 90 getProgressMonitor().indeterminateSubTask(tr("Initializing nodes to update ...")); 91 91 for (OsmPrimitive primitive : toUpdate) { 92 92 if (primitive instanceof Node && !primitive.isNew()) { 93 reader.append( (Node)primitive);93 reader.append(primitive); 94 94 } else if (primitive instanceof Way) { 95 95 Way way = (Way)primitive; 96 96 for (Node node: way.getNodes()) { … … 106 106 getProgressMonitor().indeterminateSubTask(tr("Initializing ways to update ...")); 107 107 for (OsmPrimitive primitive : toUpdate) { 108 108 if (primitive instanceof Way && !primitive.isNew()) { 109 reader.append( (Way)primitive);109 reader.append(primitive); 110 110 } 111 111 } 112 112 } … … 115 115 getProgressMonitor().indeterminateSubTask(tr("Initializing relations to update ...")); 116 116 for (OsmPrimitive primitive : toUpdate) { 117 117 if (primitive instanceof Relation && !primitive.isNew()) { 118 reader.append( (Relation)primitive);118 reader.append(primitive); 119 119 } 120 120 } 121 121 } -
src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java
155 155 } 156 156 157 157 private void updateVisibilityFromTable() { 158 ListSelectionModel s = (ListSelectionModel)table.getSelectionModel();158 ListSelectionModel s = table.getSelectionModel(); 159 159 for (int i = 0; i < layer.trackVisibility.length; i++) { 160 160 layer.trackVisibility[table.convertRowIndexToModel(i)] = s.isSelectedIndex(i); 161 161 } -
src/org/openstreetmap/josm/gui/mappaint/Cascade.java
146 146 if (o instanceof float[]) 147 147 return (float[]) o; 148 148 if (o instanceof List) { 149 List l = (List) o;149 List<?> l = (List<?>) o; 150 150 float[] a = new float[l.size()]; 151 151 for (int i=0; i<l.size(); ++i) { 152 152 Float f = toFloat(l.get(i)); -
src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
130 130 return Arrays.asList(args); 131 131 } 132 132 133 public static Object get(List objects, float index) {133 public static Object get(List<? extends Object> objects, float index) { 134 134 int idx = Math.round(index); 135 135 if (idx >= 0 && idx < objects.size()) { 136 136 return objects.get(idx); … … 138 138 return null; 139 139 } 140 140 141 public static List split(String sep, String toSplit) {141 public static List<String> split(String sep, String toSplit) { 142 142 return Arrays.asList(toSplit.split(Pattern.quote(sep), -1)); 143 143 } 144 144 … … 264 264 return a < b; 265 265 } 266 266 267 @SuppressWarnings(value = "unchecked")268 267 public static boolean equal(Object a, Object b) { 269 268 // make sure the casts are done in a meaningful way, so 270 269 // the 2 objects really can be considered equal 271 for (Class klass : new Class[]{Float.class, Boolean.class, Color.class, float[].class, String.class}) {270 for (Class<?> klass : new Class[]{Float.class, Boolean.class, Color.class, float[].class, String.class}) { 272 271 Object a2 = Cascade.convertTo(a, klass); 273 272 Object b2 = Cascade.convertTo(b, klass); 274 273 if (a2 != null && b2 != null && a2.equals(b2)) { … … 316 315 return Pattern.compile(pattern, f).matcher(target).matches(); 317 316 } 318 317 319 public static List regexp_match(String pattern, String target, String flags) {318 public static List<String> regexp_match(String pattern, String target, String flags) { 320 319 int f = 0; 321 320 if (flags.contains("i")) { 322 321 f |= Pattern.CASE_INSENSITIVE; … … 339 338 } 340 339 } 341 340 342 public static List regexp_match(String pattern, String target) {341 public static List<String> regexp_match(String pattern, String target) { 343 342 Matcher m = Pattern.compile(pattern).matcher(target); 344 343 if (m.matches()) { 345 344 List<String> result = new ArrayList<String>(m.groupCount() + 1); … … 479 478 480 479 @Override 481 480 public Object evaluate(Environment env) { 482 List l = Cascade.convertTo(arg.evaluate(env), List.class);481 List<?> l = Cascade.convertTo(arg.evaluate(env), List.class); 483 482 if (l != null) 484 483 return l.size(); 485 484 String s = Cascade.convertTo(arg.evaluate(env), String.class); -
src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
346 346 JOptionPane.INFORMATION_MESSAGE, 347 347 null // FIXME: provide help context 348 348 ); 349 } ;349 } 350 350 }); 351 351 } catch (Exception e) { 352 352 e.printStackTrace(); -
src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
116 116 if (llEditor.getValue() == 1) { 117 117 List<List<String>> data = llEditor.getData(); 118 118 @SuppressWarnings("unchecked") 119 Collection<Collection<String>> stgValue = (Collection ) stg.getValue();119 Collection<Collection<String>> stgValue = (Collection<Collection<String>>) stg.getValue(); 120 120 if (!Preferences.equalArray(stgValue, data)) { 121 121 e.setValue(new Preferences.ListListSetting(data)); 122 122 return true; -
src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
150 150 } 151 151 } 152 152 } 153 } ;153 } 154 154 155 155 156 156 /** -
src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
555 555 bg.add(aibutton); 556 556 try { 557 557 // TODO there must be a better way to parse a number like "+3" than this. 558 final int buttonvalue = ( (Number)NumberFormat.getIntegerInstance().parse(ai.replace("+", ""))).intValue();558 final int buttonvalue = (NumberFormat.getIntegerInstance().parse(ai.replace("+", ""))).intValue(); 559 559 if (auto_increment_selected == buttonvalue) aibutton.setSelected(true); 560 560 aibutton.addActionListener(new ActionListener() { 561 561 @Override -
src/org/openstreetmap/josm/io/GpxReader.java
406 406 GpxLink link = new GpxLink(url); 407 407 link.text = urlname; 408 408 @SuppressWarnings("unchecked") 409 Collection<GpxLink> links = (Collection ) attr.get(META_LINKS);409 Collection<GpxLink> links = (Collection<GpxLink>) attr.get(META_LINKS); 410 410 links.add(link); 411 411 } 412 412 } -
src/org/openstreetmap/josm/io/GpxWriter.java
81 81 for (String key : WPT_KEYS) { 82 82 if (key.equals(META_LINKS)) { 83 83 @SuppressWarnings("unchecked") 84 Collection<GpxLink> lValue = obj.getCollection(key);84 Collection<GpxLink> lValue = (Collection<GpxLink>) obj.getCollection(key); 85 85 if (lValue != null) { 86 86 for (GpxLink link : lValue) { 87 87 gpxLink(link); -
src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
134 134 final DefaultTableModel tm = new DefaultTableModel(new String[] {tr("Assume"), tr("Key"), tr("Value"), tr("Existing values")}, tags.length) { 135 135 final Class<?>[] types = {Boolean.class, String.class, Object.class, ExistingValues.class}; 136 136 @Override 137 public Class getColumnClass(int c) {137 public Class<?> getColumnClass(int c) { 138 138 return types[c]; 139 139 } 140 140 }; -
src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
384 384 PrintWriter r = new PrintWriter(w); 385 385 RequestHandler handler = null; 386 386 try { 387 Class c = handlers.get(cmd);387 Class<?> c = handlers.get(cmd); 388 388 if (c==null) return null; 389 389 handler = handlers.get(cmd).newInstance(); 390 390 } catch (Exception ex) { -
src/org/openstreetmap/josm/io/session/SessionWriter.java
72 72 Class<? extends SessionLayerExporter> exporterClass = sessionLayerExporters.get(layerClass); 73 73 if (exporterClass == null) return null; 74 74 try { 75 @SuppressWarnings("unchecked") 76 Constructor<? extends SessionLayerExporter> constructor = (Constructor) exporterClass.getConstructor(layerClass); 75 Constructor<? extends SessionLayerExporter> constructor = exporterClass.getConstructor(layerClass); 77 76 return constructor.newInstance(layer); 78 77 } catch (Exception e) { 79 78 throw new RuntimeException(e); -
src/org/openstreetmap/josm/tools/Diff.java
815 815 realindexes = new int[buffered_lines]; 816 816 817 817 for (int i = 0; i < data.length; ++i) { 818 Integer ir = (Integer)h.get(data[i]);818 Integer ir = h.get(data[i]); 819 819 if (ir == null) { 820 820 h.put(data[i],new Integer(equivs[i] = equiv_max++)); 821 821 } else { -
src/org/openstreetmap/josm/tools/ExifReader.java
50 50 return null; 51 51 } 52 52 53 @SuppressWarnings("unchecked")public static Integer readOrientation(File filename) throws ParseException {53 public static Integer readOrientation(File filename) throws ParseException { 54 54 Integer orientation = null; 55 55 try { 56 56 final Metadata metadata = JpegMetadataReader.readMetadata(filename); -
src/org/openstreetmap/josm/tools/Geometry.java
49 49 public static Set<Node> addIntersections(List<Way> ways, boolean test, List<Command> cmds) { 50 50 51 51 //stupid java, cannot instantiate array of generic classes.. 52 int n = ways.size(); 52 53 @SuppressWarnings("unchecked") 53 int n = ways.size();54 54 ArrayList<Node>[] newNodes = new ArrayList[n]; 55 55 BBox[] wayBounds = new BBox[n]; 56 56 boolean[] changedWays = new boolean[n]; … … 66 66 67 67 //iterate over all way pairs and introduce the intersections 68 68 Comparator<Node> coordsComparator = new NodePositionComparator(); 69 WayLoop:for (int seg1Way = 0; seg1Way < n; seg1Way ++) {69 for (int seg1Way = 0; seg1Way < n; seg1Way ++) { 70 70 for (int seg2Way = seg1Way; seg2Way < n; seg2Way ++) { 71 71 72 72 //do not waste time on bounds that do not intersect -
src/org/openstreetmap/josm/tools/LanguageInfo.java
17 17 BASELANGUAGE, 18 18 /** The standard english texts */ 19 19 ENGLISH 20 } ;20 } 21 21 22 22 /** 23 23 * Replies the wiki language prefix for the given locale. The wiki language -
src/org/openstreetmap/josm/tools/TextTagParser.java
109 109 110 110 private void skipSign() { 111 111 char c; 112 boolean signFound = false; ;112 boolean signFound = false; 113 113 while (pos < n) { 114 114 c = data.charAt(pos); 115 115 if (c == '\t' || c == '\n' || c == ' ') {