Changeset 9981 in josm for trunk


Ignore:
Timestamp:
2016-03-13T17:25:42+01:00 (8 years ago)
Author:
Don-vip
Message:

fix some unused code warnings

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

Legend:

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

    r9952 r9981  
    323323                // "operator" (null) should mean the same as "operator()"
    324324                // (Always). I.e. match everything
    325                 this.match = new Always();
     325                this.match = Always.INSTANCE;
    326326            } else {
    327327                this.match = match;
     
    372372     */
    373373    public static class Never extends TaggedMatch {
     374        /** The unique instance/ */
     375        public static final Never INSTANCE = new Never();
    374376        @Override
    375377        public boolean match(Tagged osm) {
     
    16121614            throw new ParseError(tr("Unexpected token: {0}", tokenizer.nextToken()));
    16131615        if (m == null)
    1614             m = new Always();
     1616            m = Always.INSTANCE;
    16151617        Main.debug("Parsed search expression is {0}", m);
    16161618        return m;
  • trunk/src/org/openstreetmap/josm/data/projection/ProjectionConfigurationException.java

    r8378 r9981  
    33
    44public class ProjectionConfigurationException extends Exception {
    5 
    6     /**
    7      * Constructs a new {@code ProjectionConfigurationException}.
    8      */
    9     public ProjectionConfigurationException() {
    10         super();
    11     }
    125
    136    /**
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java

    r9230 r9981  
    335335        subGridName = string;
    336336    }
    337 
    338     /**
    339      * Make this object a copy of the supplied GridShift
    340      * @param gs grid to copy data from
    341      */
    342     public void copy(NTV2GridShift gs) {
    343         this.lon = gs.lon;
    344         this.lat = gs.lat;
    345         this.lonShift = gs.lonShift;
    346         this.latShift = gs.latShift;
    347         this.lonAccuracy = gs.lonAccuracy;
    348         this.latAccuracy = gs.latAccuracy;
    349         this.latAccuracyAvailable = gs.latAccuracyAvailable;
    350         this.lonAccuracyAvailable = gs.lonAccuracyAvailable;
    351         this.subGridName = gs.subGridName;
    352     }
    353 
    354337}
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java

    r8870 r9981  
    6161 *
    6262 * @author Peter Yuill
    63  * Modifified for JOSM :
     63 * Modified for JOSM :
    6464 * - removed the RandomAccessFile mode (Pieren)
    6565 */
     
    267267        }
    268268        return sub;
    269     }
    270 
    271     public boolean isLoaded() {
    272         return topLevelSubGrid != null;
    273     }
    274 
    275     public void unload() {
    276         topLevelSubGrid = null;
    277269    }
    278270
     
    304296    }
    305297
    306     /**
    307      * Get a copy of the SubGrid tree for this file.
    308      *
    309      * @return a deep clone of the current SubGrid tree
    310      */
    311     public NTV2SubGrid[] getSubGridTree() {
    312         NTV2SubGrid[] clone = new NTV2SubGrid[topLevelSubGrid.length];
    313         for (int i = 0; i < topLevelSubGrid.length; i++) {
    314             clone[i] = (NTV2SubGrid) topLevelSubGrid[i].clone();
    315         }
    316         return clone;
    317     }
    318 
    319298    public String getFromEllipsoid() {
    320299        return fromEllipsoid;
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java

    r9067 r9981  
    3636 * - read grid file by single bytes. Workaround for a bug in some VM not supporting
    3737 *   file reading by group of 4 bytes from a jar file.
     38 * - removed the Cloneable interface
    3839 */
    39 public class NTV2SubGrid implements Cloneable, Serializable {
     40public class NTV2SubGrid implements Serializable {
    4041
    4142    private static final long serialVersionUID = 1L;
     
    276277    }
    277278
    278     public NTV2SubGrid getSubGrid(int index) {
    279         return (subGrid == null) ? null : subGrid[index];
    280     }
    281 
    282279    /**
    283280     * Set an array of Sub Grids of this sub grid
     
    324321
    325322    /**
    326      * Make a deep clone of this Sub Grid
    327      */
    328     @Override
    329     public Object clone() {
    330         NTV2SubGrid clone = null;
    331         try {
    332             clone = (NTV2SubGrid) super.clone();
    333             // Do a deep clone of the sub grids
    334             if (subGrid != null) {
    335                 clone.subGrid = new NTV2SubGrid[subGrid.length];
    336                 for (int i = 0; i < subGrid.length; i++) {
    337                     clone.subGrid[i] = (NTV2SubGrid) subGrid[i].clone();
    338                 }
    339             }
    340         } catch (CloneNotSupportedException cnse) {
    341             Main.warn(cnse);
    342         }
    343         return clone;
    344     }
    345 
    346     /**
    347323     * Get maximum latitude value
    348324     * @return maximum latitude
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Util.java

    r8510 r9981  
    1919 */
    2020package org.openstreetmap.josm.data.projection.datum;
    21 
    22 import org.openstreetmap.josm.Main;
    2321
    2422/**
     
    104102        return Double.longBitsToDouble(l);
    105103    }
    106 
    107     /**
    108      * Does the current VM support the New IO api
    109      * @return true or false
    110      */
    111     public static boolean isNioAvailable() {
    112         boolean nioAvailable = false;
    113         try {
    114             Class.forName("java.nio.channels.FileChannel");
    115             nioAvailable = true;
    116         } catch (NoClassDefFoundError | ClassNotFoundException cnfe) {
    117             Main.info(cnfe.getMessage());
    118         }
    119         return nioAvailable;
    120     }
    121104}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollection.java

    r9940 r9981  
    2626            }
    2727        };
    28         tagsToIgnore = new SearchCompiler.Never();
     28        tagsToIgnore = SearchCompiler.Never.INSTANCE;
    2929    }
    3030
     
    7373
    7474    public void setTagsToIgnore(SearchAction.SearchSetting tagsToIgnore) throws SearchCompiler.ParseError {
    75         setTagsToIgnore(tagsToIgnore.text.isEmpty() ? new SearchCompiler.Never() : SearchCompiler.compile(tagsToIgnore));
     75        setTagsToIgnore(tagsToIgnore.text.isEmpty() ? SearchCompiler.Never.INSTANCE : SearchCompiler.compile(tagsToIgnore));
    7676    }
    7777
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r9940 r9981  
    310310                warnAboutParseError(parseError);
    311311                tagsToIgnore = new SearchAction.SearchSetting();
    312                 recentTags.setTagsToIgnore(new SearchCompiler.Never());
     312                recentTags.setTagsToIgnore(SearchCompiler.Never.INSTANCE);
    313313            }
    314314        }
  • trunk/src/org/openstreetmap/josm/gui/widgets/CompileSearchTextDecorator.java

    r9978 r9981  
    4545            textComponent.setBackground(new Color(255, 224, 224));
    4646            textComponent.setToolTipText(ex.getMessage());
    47             filter = new SearchCompiler.Always();
     47            filter = SearchCompiler.Always.INSTANCE;
    4848        }
    4949        textComponent.firePropertyChange("filter", 0, 1);
Note: See TracChangeset for help on using the changeset viewer.