Changeset 6142 in josm


Ignore:
Timestamp:
2013-08-11T21:23:19+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8902 - fix compilation warnings

Location:
trunk/src/org/openstreetmap/josm
Files:
29 edited

Legend:

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

    r6104 r6142  
    120120            if (Main.map.mapView.viewportFollowing) {
    121121                Main.map.mapView.smoothScrollTo(newPoint.getEastNorth());
    122             };
     122            }
    123123        }
    124124    }
  • trunk/src/org/openstreetmap/josm/command/SequenceCommand.java

    r5926 r6142  
    9797
    9898    @Override
    99     @SuppressWarnings("unchecked")
    10099    public Collection<PseudoCommand> getChildren() {
    101         return (List) Arrays.asList(sequence);
     100        return Arrays.<PseudoCommand>asList(sequence);
    102101    }
    103102
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r6084 r6142  
    10851085        }
    10861086
    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)) { }
    10911091
    10921092        stringMap.putAll(tmpPref.properties);
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r6087 r6142  
    12881288                changed = putListOfStructs(key, setting.getValue());
    12891289            }
    1290         };
     1290        }
    12911291        PutVisitor putVisitor = new PutVisitor();
    12921292        value.visit(putVisitor);
     
    16691669    }
    16701670
    1671     public static boolean isEqual(Setting a, Setting b) {
     1671    public static boolean isEqual(Setting<?> a, Setting<?> b) {
    16721672        if (a==null && b==null) return true;
    16731673        if (a==null) return false;
     
    16781678            return (a.getValue().equals(b.getValue()));
    16791679        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();
    16821682            return equalCollection(aValue, bValue);
    16831683        }
    16841684        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();
    16871687            return equalArray(aValue, bValue);
    16881688        }
    16891689        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();
    16921692            return equalListOfStructs(aValue, bValue);
    16931693        }
  • trunk/src/org/openstreetmap/josm/data/gpx/IWithAttributes.java

    r6069 r6142  
    3737     * @since 5502
    3838     */
    39     Collection getCollection(String key);
     39    Collection<?> getCollection(String key);
    4040
    4141    /**
  • trunk/src/org/openstreetmap/josm/data/gpx/WithAttributes.java

    r5684 r6142  
    5757     */
    5858    @Override
    59     public Collection getCollection(String key) {
     59    public Collection<?> getCollection(String key) {
    6060        Object value = attr.get(key);
    61         return (value instanceof Collection) ? (Collection)value : null;
     61        return (value instanceof Collection) ? (Collection<?>)value : null;
    6262    }
    6363
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r6104 r6142  
    327327
    328328    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);
    330330        if (id == null) throw new ProjectionConfigurationException(tr("Projection required (+proj=*)"));
    331331
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java

    r5230 r6142  
    2424            this.latitudeOrigin = latitudeOrigin;
    2525        }
    26     };
     26    }
    2727
    2828    public static class Parameters1SP extends Parameters {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r6083 r6142  
    822822                return noMatch;
    823823            }
    824         };
     824        }
    825825
    826826        public String getData(String str) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java

    r6069 r6142  
    5050        NAMED_WAYS.add( "tertiary" );
    5151        NAMED_WAYS.add( "residential" );
    52         NAMED_WAYS.add( "pedestrian" ); ;
     52        NAMED_WAYS.add( "pedestrian" );
    5353    }
    5454
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r6096 r6142  
    494494                        // fixme - not use zoom history here
    495495                        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) { }
    497497                    }
    498498                }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r6109 r6142  
    851851            return String.class;
    852852        }
    853     };
     853    }
    854854
    855855    /**
  • trunk/src/org/openstreetmap/josm/gui/io/UpdatePrimitivesTask.java

    r6084 r6142  
    9191        for (OsmPrimitive primitive : toUpdate) {
    9292            if (primitive instanceof Node && !primitive.isNew()) {
    93                 reader.append((Node)primitive);
     93                reader.append(primitive);
    9494            } else if (primitive instanceof Way) {
    9595                Way way = (Way)primitive;
     
    107107        for (OsmPrimitive primitive : toUpdate) {
    108108            if (primitive instanceof Way && !primitive.isNew()) {
    109                 reader.append((Way)primitive);
     109                reader.append(primitive);
    110110            }
    111111        }
     
    116116        for (OsmPrimitive primitive : toUpdate) {
    117117            if (primitive instanceof Relation && !primitive.isNew()) {
    118                 reader.append((Relation)primitive);
     118                reader.append(primitive);
    119119            }
    120120        }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r6101 r6142  
    156156
    157157    private void updateVisibilityFromTable() {
    158         ListSelectionModel s = (ListSelectionModel) table.getSelectionModel();
     158        ListSelectionModel s = table.getSelectionModel();
    159159        for (int i = 0; i < layer.trackVisibility.length; i++) {
    160160            layer.trackVisibility[table.convertRowIndexToModel(i)] = s.isSelectedIndex(i);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java

    r6070 r6142  
    147147            return (float[]) o;
    148148        if (o instanceof List) {
    149             List l = (List) o;
     149            List<?> l = (List<?>) o;
    150150            float[] a = new float[l.size()];
    151151            for (int i=0; i<l.size(); ++i) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r5714 r6142  
    131131        }
    132132
    133         public static Object get(List objects, float index) {
     133        public static Object get(List<? extends Object> objects, float index) {
    134134            int idx = Math.round(index);
    135135            if (idx >= 0 && idx < objects.size()) {
     
    139139        }
    140140
    141         public static List split(String sep, String toSplit) {
     141        public static List<String> split(String sep, String toSplit) {
    142142            return Arrays.asList(toSplit.split(Pattern.quote(sep), -1));
    143143        }
     
    265265        }
    266266
    267         @SuppressWarnings(value = "unchecked")
    268267        public static boolean equal(Object a, Object b) {
    269268            // make sure the casts are done in a meaningful way, so
    270269            // 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}) {
    272271                Object a2 = Cascade.convertTo(a, klass);
    273272                Object b2 = Cascade.convertTo(b, klass);
     
    317316        }
    318317
    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) {
    320319            int f = 0;
    321320            if (flags.contains("i")) {
     
    340339        }
    341340
    342         public static List regexp_match(String pattern, String target) {
     341        public static List<String> regexp_match(String pattern, String target) {
    343342            Matcher m = Pattern.compile(pattern).matcher(target);
    344343            if (m.matches()) {
     
    480479        @Override
    481480        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);
    483482            if (l != null)
    484483                return l.size();
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r6087 r6142  
    347347                                null // FIXME: provide help context
    348348                                );
    349                     };
     349                    }
    350350                });
    351351            } catch (Exception e) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java

    r6022 r6142  
    117117                List<List<String>> data = llEditor.getData();
    118118                @SuppressWarnings("unchecked")
    119                 Collection<Collection<String>> stgValue = (Collection) stg.getValue();
     119                Collection<Collection<String>> stgValue = (Collection<Collection<String>>) stg.getValue();
    120120                if (!Preferences.equalArray(stgValue, data)) {
    121121                    e.setValue(new Preferences.ListListSetting(data));
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java

    r6087 r6142  
    151151            }
    152152        }
    153     };
     153    }
    154154
    155155
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    r6114 r6142  
    578578                    try {
    579579                        // TODO there must be a better way to parse a number like "+3" than this.
    580                         final int buttonvalue = ((Number)NumberFormat.getIntegerInstance().parse(ai.replace("+", ""))).intValue();
     580                        final int buttonvalue = (NumberFormat.getIntegerInstance().parse(ai.replace("+", ""))).intValue();
    581581                        if (auto_increment_selected == buttonvalue) aibutton.setSelected(true);
    582582                        aibutton.addActionListener(new ActionListener() {
  • trunk/src/org/openstreetmap/josm/io/GpxReader.java

    r6117 r6142  
    409409                link.text = urlname;
    410410                @SuppressWarnings({ "unchecked", "rawtypes" })
    411                 Collection<GpxLink> links = (Collection) attr.get(META_LINKS);
     411                Collection<GpxLink> links = (Collection<GpxLink>) attr.get(META_LINKS);
    412412                links.add(link);
    413413            }
  • trunk/src/org/openstreetmap/josm/io/GpxWriter.java

    r6070 r6142  
    8282            if (key.equals(META_LINKS)) {
    8383                @SuppressWarnings("unchecked")
    84                 Collection<GpxLink> lValue = obj.getCollection(key);
     84                Collection<GpxLink> lValue = (Collection<GpxLink>) obj.getCollection(key);
    8585                if (lValue != null) {
    8686                    for (GpxLink link : lValue) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r6104 r6142  
    135135            final Class<?>[] types = {Boolean.class, String.class, Object.class, ExistingValues.class};
    136136            @Override
    137             public Class getColumnClass(int c) {
     137            public Class<?> getColumnClass(int c) {
    138138                return types[c];
    139139            }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r6091 r6142  
    385385        RequestHandler handler = null;
    386386        try {
    387             Class c = handlers.get(cmd);
     387            Class<?> c = handlers.get(cmd);
    388388            if (c==null) return null;
    389389            handler = handlers.get(cmd).newInstance();
  • trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java

    r6093 r6142  
    7373        if (exporterClass == null) return null;
    7474        try {
    75             @SuppressWarnings("unchecked")
    76             Constructor<? extends SessionLayerExporter> constructor = (Constructor) exporterClass.getConstructor(layerClass);
     75            Constructor<? extends SessionLayerExporter> constructor = exporterClass.getConstructor(layerClass);
    7776            return constructor.newInstance(layer);
    7877        } catch (Exception e) {
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r6084 r6142  
    816816
    817817            for (int i = 0; i < data.length; ++i) {
    818                 Integer ir = (Integer)h.get(data[i]);
     818                Integer ir = h.get(data[i]);
    819819                if (ir == null) {
    820820                    h.put(data[i],new Integer(equivs[i] = equiv_max++));
  • trunk/src/org/openstreetmap/josm/tools/ExifReader.java

    r6127 r6142  
    5151    }
    5252
    53     @SuppressWarnings("unchecked") public static Integer readOrientation(File filename) throws ParseException {
     53    public static Integer readOrientation(File filename) throws ParseException {
    5454        Integer orientation = null;
    5555        try {
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r6070 r6142  
    1818        /** The standard english texts */
    1919        ENGLISH
    20     };
     20    }
    2121
    2222    /**
  • trunk/src/org/openstreetmap/josm/tools/TextTagParser.java

    r6085 r6142  
    110110        private void skipSign() {
    111111            char c;
    112             boolean signFound = false;;
     112            boolean signFound = false;
    113113            while (pos < n) {
    114114                c = data.charAt(pos);
Note: See TracChangeset for help on using the changeset viewer.