Ignore:
Timestamp:
2015-10-10T21:01:42+02:00 (4 years ago)
Author:
Don-vip
Message:

sonar - Unused private method should be removed
sonar - Unused protected methods should be removed
sonar - Sections of code should not be "commented out"
sonar - Empty statements should be removed
sonar - squid:S1172 - Unused method parameters should be removed
sonar - squid:S1481 - Unused local variables should be removed

Location:
trunk/src/org/openstreetmap/josm/io
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r8846 r8855  
    1414import java.util.LinkedHashSet;
    1515import java.util.List;
    16 import java.util.NoSuchElementException;
    1716import java.util.Set;
    1817import java.util.concurrent.Callable;
     
    3736import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3837import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    39 import org.openstreetmap.josm.tools.CheckParameterUtil;
    4038import org.openstreetmap.josm.tools.Utils;
    4139
     
    9997        case RELATION: relations.add(id.getUniqueId()); break;
    10098        }
    101     }
    102 
    103     /**
    104      * remembers an {@link OsmPrimitive}'s id. <code>ds</code> must include
    105      * an {@link OsmPrimitive} with id=<code>id</code>. The id will
    106      * later we fetched as part of a Multi Get request.
    107      *
    108      * Ignore the id if it id &lt;= 0.
    109      *
    110      * @param ds  the dataset (must not be null)
    111      * @param id  the primitive id
    112      * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
    113      * {@link OsmPrimitiveType#RELATION RELATION}
    114      * @throws IllegalArgumentException if ds is null
    115      * @throws NoSuchElementException if ds does not include an {@link OsmPrimitive} with id=<code>id</code>
    116      */
    117     protected void remember(DataSet ds, long id, OsmPrimitiveType type) throws NoSuchElementException {
    118         CheckParameterUtil.ensureParameterNotNull(ds, "ds");
    119         if (id <= 0) return;
    120         OsmPrimitive primitive = ds.getPrimitiveById(id, type);
    121         if (primitive == null)
    122             throw new NoSuchElementException(tr("No primitive with id {0} in local dataset. Cannot infer primitive type.", id));
    123         remember(primitive.getPrimitiveId());
    124         return;
    12599    }
    126100
  • trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java

    r8394 r8855  
    1515import org.openstreetmap.josm.data.osm.DataSet;
    1616import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    17 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1817import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    1918import org.openstreetmap.josm.gui.util.GuiHelper;
     
    4544    }
    4645
    47     protected void importData(InputStream in, final File associatedFile) throws IllegalDataException {
    48         importData(in, associatedFile, NullProgressMonitor.INSTANCE);
    49     }
    50 
    5146    protected void importData(InputStream in, final File associatedFile, ProgressMonitor  progressMonitor) throws IllegalDataException {
    5247        final DataSet dataSet = OsmChangeReader.parseDataSet(in, progressMonitor);
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java

    r8840 r8855  
    7979        private StringBuilder text;
    8080
    81         protected void parseChangesetAttributes(Changeset cs, Attributes atts) throws XmlParsingException {
     81        protected void parseChangesetAttributes(Attributes atts) throws XmlParsingException {
    8282            // -- id
    8383            String value = atts.getValue("id");
     
    204204            case "changeset":
    205205                current = new Changeset();
    206                 parseChangesetAttributes(current, atts);
     206                parseChangesetAttributes(atts);
    207207                break;
    208208            case "tag":
  • trunk/src/org/openstreetmap/josm/io/OsmImporter.java

    r8509 r8855  
    1616import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    1717import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    18 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1918import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2019import org.openstreetmap.josm.gui.util.GuiHelper;
     
    7877            throw new IOException(tr("File ''{0}'' does not exist.", file.getName()), e);
    7978        }
    80     }
    81 
    82     /**
    83      * Imports OSM data from stream
    84      * @param in input stream
    85      * @param associatedFile filename of data
    86      */
    87     protected void importData(InputStream in, final File associatedFile) throws IllegalDataException {
    88         importData(in, associatedFile, NullProgressMonitor.INSTANCE);
    8979    }
    9080
Note: See TracChangeset for help on using the changeset viewer.