Ignore:
Timestamp:
2016-02-23T02:11:42+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S2272 - "Iterator.next()" methods should throw "NoSuchElementException" + javadoc/code style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r9073 r9854  
    1111import java.util.List;
    1212import java.util.Map;
     13import java.util.NoSuchElementException;
    1314import java.util.Set;
    1415
     
    3233    public boolean fromServer;
    3334
     35    /** Creator (usually software) */
    3436    public String creator;
    3537
     38    /** Tracks */
    3639    public final Collection<GpxTrack> tracks = new LinkedList<>();
     40    /** Routes */
    3741    public final Collection<GpxRoute> routes = new LinkedList<>();
     42    /** Waypoints */
    3843    public final Collection<WayPoint> waypoints = new LinkedList<>();
    3944
     
    4651    public final Set<DataSource> dataSources = new HashSet<>();
    4752
     53    /**
     54     * Merges data from another object.
     55     * @param other existing GPX data
     56     */
    4857    public void mergeFrom(GpxData other) {
    4958        if (storageFile == null && other.storageFile != null) {
     
    361370    }
    362371
     372    /**
     373     * Resets the internal caches of east/north coordinates.
     374     */
    363375    public void resetEastNorthCache() {
    364376        if (waypoints != null) {
     
    401413        private final boolean[] trackVisibility;
    402414
     415        /**
     416         * Constructs a new {@code LinesIterator}.
     417         * @param data GPX data
     418         * @param trackVisibility An array indicating which tracks should be
     419         * included in the iteration. Can be null, then all tracks are included.
     420         */
    403421        public LinesIterator(GpxData data, boolean[] trackVisibility) {
    404422            itTracks = data.tracks.iterator();
     
    416434        @Override
    417435        public Collection<WayPoint> next() {
     436            if (!hasNext()) {
     437                throw new NoSuchElementException();
     438            }
    418439            Collection<WayPoint> current = next;
    419440            next = getNext();
Note: See TracChangeset for help on using the changeset viewer.