Changeset 9983 in josm for trunk/src/org


Ignore:
Timestamp:
2016-03-13T21:36:47+01:00 (9 years ago)
Author:
Don-vip
Message:

remove unused code

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

Legend:

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

    r9439 r9983  
    287287
    288288        /**
    289          * Constructs a new {@code NodePair}.
    290          * @param other An existing {@code NodePair}
    291          */
    292         public NodePair(NodePair other) {
    293             this(other.a, other.b);
    294         }
    295 
    296         /**
    297289         * Replies the first node.
    298290         * @return The first node
     
    308300        public Node getB() {
    309301            return b;
    310         }
    311 
    312         public boolean isAdjacentToA(NodePair other) {
    313             return other.getA() == a || other.getB() == a;
    314         }
    315 
    316         public boolean isAdjacentToB(NodePair other) {
    317             return other.getA() == b || other.getB() == b;
    318302        }
    319303
  • trunk/src/org/openstreetmap/josm/actions/DialogsToggleAction.java

    r9006 r9983  
    4343    }
    4444
    45     /**
    46      * To call if this action must be initially run at JOSM startup.
    47      */
    48     public void initial() {
    49         if (isSelected()) {
    50             setMode();
    51         }
    52     }
    53 
    5445    protected void setMode() {
    5546        if (Main.isDisplayingMapView()) {
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r9759 r9983  
    326326            deleteFileOrDirectory(fOut);
    327327        }
    328     }
    329 
    330     public static void deleteFileOrDirectory(String path) {
    331         deleteFileOrDirectory(new File(path));
    332328    }
    333329
  • trunk/src/org/openstreetmap/josm/data/cache/ICachedLoaderJob.java

    r8795 r9983  
    1111 * @param <K> cache key type
    1212 */
    13 public interface ICachedLoaderJob<K> {
     13public interface ICachedLoaderJob<K> extends Runnable {
    1414    /**
    1515     * returns cache entry key
     
    2626     */
    2727    URL getUrl() throws IOException;
    28 
    29     /**
    30      * implements the main algorithm for fetching
    31      */
    32     void run();
    3328
    3429    /**
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r9709 r9983  
    4545 * @since 8168
    4646 */
    47 public abstract class JCSCachedTileLoaderJob<K, V extends CacheEntry> implements ICachedLoaderJob<K>, Runnable {
     47public abstract class JCSCachedTileLoaderJob<K, V extends CacheEntry> implements ICachedLoaderJob<K> {
    4848    private static final Logger log = FeatureAdapter.getLogger(JCSCachedTileLoaderJob.class.getCanonicalName());
    4949    protected static final long DEFAULT_EXPIRE_TIME = 1000L * 60 * 60 * 24 * 7; // 7 days
  • trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java

    r9375 r9983  
    9393
    9494    /**
    95      * Converts to single point BBox.
    96      *
    97      * @return single point BBox defined by this coordinate.
    98      * @since 6203
    99      */
    100     public BBox toBBox() {
    101         return new BBox(x, y);
    102     }
    103 
    104     /**
    10595     * Creates bbox around this coordinate. Coordinate defines
    10696     * center of bbox, its edge will be 2*r.
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r9950 r9983  
    4848    public static final double MAX_SERVER_PRECISION = 1e-7;
    4949    public static final double MAX_SERVER_INV_PRECISION = 1e7;
    50     public static final int    MAX_SERVER_DIGITS = 7;
    5150
    5251    /**
  • trunk/src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java

    r9921 r9983  
    540540        return (options & flag) == 0;
    541541    }
    542 
    543     // Unit test access to pattern matcher
    544     Matcher matchURL(String value) {
    545         return URL_PATTERN.matcher(value);
    546     }
    547542}
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r9866 r9983  
    545545
    546546    /**
    547      * Call this if you "accidentally" called toggleEnable. This doesn't need
    548      * to be called for every dialog, as it's the default anyway.
    549      * @return {@code this}
    550      */
    551     public ExtendedDialog toggleDisable() {
    552         this.toggleable = false;
    553         return this;
    554     }
    555 
    556     /**
    557547     * Sets the button that will react to ENTER.
    558548     * @param defaultButtonIdx The button index (starts to 1)
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r9623 r9983  
    8787            return sources;
    8888        }
    89 
    90         public static void addExistingSlippyMapUrl(String url) {
    91             existingSlippyMapUrls.add(url);
    92         }
    9389    }
    9490
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r9078 r9983  
    5757    /** Small icon size for use in graphics calculations */
    5858    public static final int ICON_SMALL_SIZE = 16;
    59     /** Large icon size for use in graphics calculations */
    60     public static final int ICON_LARGE_SIZE = 24;
    6159    /** 24x24 icon for unresolved notes */
    6260    public static final ImageIcon ICON_OPEN = ImageProvider.get("dialogs/notes", "note_open");
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableCellRenderer.java

    r9223 r9983  
    1919 */
    2020public abstract class MemberTableCellRenderer extends JLabel implements TableCellRenderer {
    21     public static final Color BGCOLOR_EMPTY_ROW = new Color(234, 234, 234);
    2221    public static final Color BGCOLOR_IN_JOSM_SELECTION = new Color(235, 255, 177);
    2322
    24     public static final Color BGCOLOR_NOT_IN_OPPOSITE = new Color(255, 197, 197);
    2523    public static final Color BGCOLOR_DOUBLE_ENTRY = new Color(254, 226, 214);
    2624
  • trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java

    r9223 r9983  
    2525 */
    2626public class RelationMemberListTableCellRenderer extends JLabel implements TableCellRenderer {
    27 
    28     public static final Color BGCOLOR_EMPTY_ROW = new Color(234, 234, 234);
    29     public static final Color BGCOLOR_NOT_IN_OPPOSITE = new Color(255, 197, 197);
    30     public static final Color BGCOLOR_IN_OPPOSITE = new Color(255, 234, 213);
    31     public static final Color BGCOLOR_SELECTED = new Color(143, 170, 255);
    3227
    3328    private final transient Map<OsmPrimitiveType, ImageIcon> icons;
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTableColumnModel.java

    r5622 r9983  
    1515public class VersionTableColumnModel extends DefaultTableColumnModel {
    1616
     17    /** Column index for version */
    1718    public static final int COL_VERSION = 0;
     19    /** Column index for reference */
    1820    public static final int COL_REFERENCE = 1;
     21    /** Column index for current */
    1922    public static final int COL_CURRENT = 2;
     23    /** Column index for date */
    2024    public static final int COL_DATE = 3;
     25    /** Column index for user */
    2126    public static final int COL_USER = 4;
    2227
     
    2631
    2732        // column 0 - Version
    28         col = new TableColumn(0);
     33        col = new TableColumn(COL_VERSION);
    2934        /* translation note: 3 letter abbr. for "Version" */
    3035        col.setHeaderValue(tr("Ver"));
     
    3338        addColumn(col);
    3439        // column 1 - Reference
    35         col = new TableColumn(1);
     40        col = new TableColumn(COL_REFERENCE);
    3641        col.setHeaderValue(tr("A"));
    3742        col.setCellRenderer(bRenderer);
     
    4045        addColumn(col);
    4146        // column 2 - Current
    42         col = new TableColumn(2);
     47        col = new TableColumn(COL_CURRENT);
    4348        col.setHeaderValue(tr("B"));
    4449        col.setCellRenderer(bRenderer);
     
    4752        addColumn(col);
    4853        // column 3 - Date
    49         col = new TableColumn(3);
     54        col = new TableColumn(COL_DATE);
    5055        col.setHeaderValue(tr("Date"));
    5156        col.setResizable(false);
    5257        addColumn(col);
    5358        // column 4 - User
    54         col = new TableColumn(4);
     59        col = new TableColumn(COL_USER);
    5560        col.setHeaderValue(tr("User"));
    5661        col.setResizable(false);
  • trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java

    r9949 r9983  
    88import java.awt.Color;
    99import java.awt.Component;
    10 import java.awt.Font;
    11 import java.awt.Graphics2D;
    1210import java.awt.GridBagLayout;
    1311import java.awt.Transparency;
    1412import java.awt.event.ActionEvent;
    15 import java.awt.font.FontRenderContext;
    16 import java.awt.font.LineBreakMeasurer;
    17 import java.awt.font.TextAttribute;
    18 import java.awt.font.TextLayout;
    1913import java.awt.image.BufferedImage;
    2014import java.awt.image.BufferedImageOp;
     
    2317import java.awt.image.LookupOp;
    2418import java.awt.image.ShortLookupTable;
    25 import java.text.AttributedCharacterIterator;
    26 import java.text.AttributedString;
    2719import java.util.ArrayList;
    28 import java.util.HashMap;
    2920import java.util.List;
    30 import java.util.Map;
    3121
    3222import javax.swing.AbstractAction;
     
    387377    }
    388378
    389     /**
    390      * Draws a red error tile when imagery tile cannot be fetched.
    391      * @param img The buffered image
    392      * @param message Additional error message to display
    393      */
    394     public void drawErrorTile(BufferedImage img, String message) {
    395         Graphics2D g = (Graphics2D) img.getGraphics();
    396         g.setColor(Color.RED);
    397         g.fillRect(0, 0, img.getWidth(), img.getHeight());
    398         g.setFont(g.getFont().deriveFont(Font.PLAIN).deriveFont(24.0f));
    399         g.setColor(Color.BLACK);
    400 
    401         String text = tr("ERROR");
    402         g.drawString(text, (img.getWidth() - g.getFontMetrics().stringWidth(text)) / 2, g.getFontMetrics().getHeight()+5);
    403         if (message != null) {
    404             float drawPosY = 2.5f*g.getFontMetrics().getHeight()+10;
    405             if (!message.contains(" ")) {
    406                 g.setFont(g.getFont().deriveFont(Font.PLAIN).deriveFont(18.0f));
    407                 g.drawString(message, 5, (int) drawPosY);
    408             } else {
    409                 // Draw message on several lines
    410                 Map<TextAttribute, Object> map = new HashMap<>();
    411                 map.put(TextAttribute.FAMILY, "Serif");
    412                 map.put(TextAttribute.SIZE, new Float(18.0));
    413                 AttributedString vanGogh = new AttributedString(message, map);
    414                 // Create a new LineBreakMeasurer from the text
    415                 AttributedCharacterIterator paragraph = vanGogh.getIterator();
    416                 int paragraphStart = paragraph.getBeginIndex();
    417                 int paragraphEnd = paragraph.getEndIndex();
    418                 FontRenderContext frc = g.getFontRenderContext();
    419                 LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(paragraph, frc);
    420                 // Set break width to width of image with some margin
    421                 float breakWidth = img.getWidth()-10;
    422                 // Set position to the index of the first character in the text
    423                 lineMeasurer.setPosition(paragraphStart);
    424                 // Get lines until the entire paragraph has been displayed
    425                 while (lineMeasurer.getPosition() < paragraphEnd) {
    426                     // Retrieve next layout
    427                     TextLayout layout = lineMeasurer.nextLayout(breakWidth);
    428 
    429                     // Compute pen x position
    430                     float drawPosX = layout.isLeftToRight() ? 0 : breakWidth - layout.getAdvance();
    431 
    432                     // Move y-coordinate by the ascent of the layout
    433                     drawPosY += layout.getAscent();
    434 
    435                     // Draw the TextLayout at (drawPosX, drawPosY)
    436                     layout.draw(g, drawPosX, drawPosY);
    437 
    438                     // Move y-coordinate in preparation for next layout
    439                     drawPosY += layout.getDescent() + layout.getLeading();
    440                 }
    441             }
    442         }
    443     }
    444 
    445379    @Override
    446380    public void destroy() {
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r9860 r9983  
    4343    /** should WMS layer autozoom in default mode */
    4444    public static final BooleanProperty PROP_DEFAULT_AUTOZOOM = new BooleanProperty(PREFERENCE_PREFIX + "default_autozoom", true);
    45 
    46     /** limit of concurrent connections to WMS tile source (per source) */
    47     public static final IntegerProperty THREAD_LIMIT = new IntegerProperty(PREFERENCE_PREFIX + "simultaneousConnections", 3);
    4845
    4946    private static final String CACHE_REGION_NAME = "WMS";
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java

    r9341 r9983  
    1919 */
    2020public final class Cascade implements Cloneable {
    21 
    22     public static final Cascade EMPTY_CASCADE = new Cascade();
    2321
    2422    private Map<String, Object> prop = new HashMap<>();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r9540 r9983  
    523523         * @return {@code true} if the way is closed or the relation is a closed multipolygon
    524524         */
    525         static boolean closed(Environment e) {
     525        static boolean closed(Environment e) { // NO_UCD (unused code)
    526526            if (e.osm instanceof Way && ((Way) e.osm).isClosed())
    527527                return true;
     
    537537         * @see OsmPrimitive#isModified()
    538538         */
    539         static boolean modified(Environment e) {
     539        static boolean modified(Environment e) { // NO_UCD (unused code)
    540540            return e.osm.isModified() || e.osm.isNewOrUndeleted();
    541541        }
     
    547547         * @see OsmPrimitive#isNew()
    548548         */
    549         static boolean _new(Environment e) {
     549        static boolean _new(Environment e) { // NO_UCD (unused code)
    550550            return e.osm.isNew();
    551551        }
     
    557557         * @see Node#isConnectionNode()
    558558         */
    559         static boolean connection(Environment e) {
     559        static boolean connection(Environment e) { // NO_UCD (unused code)
    560560            return e.osm instanceof Node && e.osm.getDataSet() != null && ((Node) e.osm).isConnectionNode();
    561561        }
     
    567567         * @see OsmPrimitive#isTagged()
    568568         */
    569         static boolean tagged(Environment e) {
     569        static boolean tagged(Environment e) { // NO_UCD (unused code)
    570570            return e.osm.isTagged();
    571571        }
     
    577577         * @see OsmPrimitive#hasSameInterestingTags(OsmPrimitive)
    578578         */
    579         static boolean sameTags(Environment e) {
     579        static boolean sameTags(Environment e) { // NO_UCD (unused code)
    580580            return e.osm.hasSameInterestingTags(Utils.firstNonNull(e.child, e.parent));
    581581        }
     
    587587         * @see ElemStyles#hasAreaElemStyle(OsmPrimitive, boolean)
    588588         */
    589         static boolean areaStyle(Environment e) {
     589        static boolean areaStyle(Environment e) { // NO_UCD (unused code)
    590590            // only for validator
    591591            return ElemStyles.hasAreaElemStyle(e.osm, false);
     
    597597         * @return {@code true} if the object is a unconnected node
    598598         */
    599         static boolean unconnected(Environment e) {
     599        static boolean unconnected(Environment e) { // NO_UCD (unused code)
    600600            return e.osm instanceof Node && OsmPrimitive.getFilteredList(e.osm.getReferrers(), Way.class).isEmpty();
    601601        }
     
    607607         * @see ExpressionFactory.Functions#is_right_hand_traffic(Environment)
    608608         */
    609         static boolean righthandtraffic(Environment e) {
     609        static boolean righthandtraffic(Environment e) { // NO_UCD (unused code)
    610610            return ExpressionFactory.Functions.is_right_hand_traffic(e);
    611611        }
     
    618618         * @see ExpressionFactory.Functions#is_clockwise(Environment)
    619619         */
    620         static boolean clockwise(Environment e) {
     620        static boolean clockwise(Environment e) { // NO_UCD (unused code)
    621621            return ExpressionFactory.Functions.is_clockwise(e);
    622622        }
     
    629629         * @see ExpressionFactory.Functions#is_anticlockwise(Environment)
    630630         */
    631         static boolean anticlockwise(Environment e) {
     631        static boolean anticlockwise(Environment e) { // NO_UCD (unused code)
    632632            return ExpressionFactory.Functions.is_anticlockwise(e);
    633633        }
     
    638638         * @return {@code true} if the object is an unclosed multipolygon
    639639         */
    640         static boolean unclosed_multipolygon(Environment e) {
     640        static boolean unclosed_multipolygon(Environment e) { // NO_UCD (unused code)
    641641            return e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() &&
    642642                    !e.osm.isIncomplete() && !((Relation) e.osm).hasIncompleteMembers() &&
     
    652652         * @see InDataSourceArea
    653653         */
    654         static boolean inDownloadedArea(Environment e) {
     654        static boolean inDownloadedArea(Environment e) { // NO_UCD (unused code)
    655655            return IN_DOWNLOADED_AREA.evaluate(e.osm);
    656656        }
    657657
    658         static boolean completely_downloaded(Environment e) {
     658        static boolean completely_downloaded(Environment e) { // NO_UCD (unused code)
    659659            if (e.osm instanceof Relation) {
    660660                return !((Relation) e.osm).hasIncompleteMembers();
     
    664664        }
    665665
    666         static boolean closed2(Environment e) {
     666        static boolean closed2(Environment e) { // NO_UCD (unused code)
    667667            if (e.osm instanceof Way && ((Way) e.osm).isClosed())
    668668                return true;
     
    672672        }
    673673
    674         static boolean selected(Environment e) {
     674        static boolean selected(Environment e) { // NO_UCD (unused code)
    675675            Cascade c = e.mc.getCascade(e.layer);
    676676            c.setDefaultSelectedHandling(false);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r9952 r9983  
    122122         * @return {@code o} unchanged
    123123         */
    124         public static Object eval(Object o) {
     124        public static Object eval(Object o) { // NO_UCD (unused code)
    125125            return o;
    126126        }
     
    131131         * @return Sum of arguments
    132132         */
    133         public static float plus(float... args) {
     133        public static float plus(float... args) { // NO_UCD (unused code)
    134134            float res = 0;
    135135            for (float f : args) {
     
    144144         * @return Substraction of arguments
    145145         */
    146         public static Float minus(float... args) {
     146        public static Float minus(float... args) { // NO_UCD (unused code)
    147147            if (args.length == 0) {
    148148                return 0.0F;
     
    163163         * @return Multiplication of arguments
    164164         */
    165         public static float times(float... args) {
     165        public static float times(float... args) { // NO_UCD (unused code)
    166166            float res = 1;
    167167            for (float f : args) {
     
    176176         * @return Division of arguments
    177177         */
    178         public static Float divided_by(float... args) {
     178        public static Float divided_by(float... args) { // NO_UCD (unused code)
    179179            if (args.length == 0) {
    180180                return 1.0F;
     
    196196         * @see Arrays#asList(Object[])
    197197         */
    198         public static List<Object> list(Object... args) {
     198        public static List<Object> list(Object... args) { // NO_UCD (unused code)
    199199            return Arrays.asList(args);
    200200        }
     
    205205         * @return length of the list
    206206         */
    207         public static Integer count(List<?> lst) {
     207        public static Integer count(List<?> lst) { // NO_UCD (unused code)
    208208            return lst.size();
    209209        }
     
    217217         */
    218218        @NullableArguments
    219         public static Object any(Object... args) {
     219        public static Object any(Object... args) { // NO_UCD (unused code)
    220220            return Utils.firstNonNull(args);
    221221        }
     
    228228         * @since 5699
    229229         */
    230         public static Object get(List<?> lst, float n) {
     230        public static Object get(List<?> lst, float n) { // NO_UCD (unused code)
    231231            int idx = Math.round(n);
    232232            if (idx >= 0 && idx < lst.size()) {
     
    244244         * @since 5699
    245245         */
    246         public static List<String> split(String sep, String toSplit) {
     246        public static List<String> split(String sep, String toSplit) { // NO_UCD (unused code)
    247247            return Arrays.asList(toSplit.split(Pattern.quote(sep), -1));
    248248        }
     
    256256         * @see Color#Color(float, float, float)
    257257         */
    258         public static Color rgb(float r, float g, float b) {
     258        public static Color rgb(float r, float g, float b) { // NO_UCD (unused code)
    259259            try {
    260260                return new Color(r, g, b);
     
    274274         * @see Color#Color(float, float, float, float)
    275275         */
    276         public static Color rgba(float r, float g, float b, float alpha) {
     276        public static Color rgba(float r, float g, float b, float alpha) { // NO_UCD (unused code)
    277277            try {
    278278                return new Color(r, g, b, alpha);
     
    289289         * @return the corresponding color
    290290         */
    291         public static Color hsb_color(float h, float s, float b) {
     291        public static Color hsb_color(float h, float s, float b) { // NO_UCD (unused code)
    292292            try {
    293293                return Color.getHSBColor(h, s, b);
     
    302302         * @return color matching the given notation
    303303         */
    304         public static Color html2color(String html) {
     304        public static Color html2color(String html) { // NO_UCD (unused code)
    305305            return ColorHelper.html2color(html);
    306306        }
     
    311311         * @return HTML notation matching the given color
    312312         */
    313         public static String color2html(Color c) {
     313        public static String color2html(Color c) { // NO_UCD (unused code)
    314314            return ColorHelper.color2html(c);
    315315        }
     
    321321         * @see java.awt.Color#getRed()
    322322         */
    323         public static float red(Color c) {
     323        public static float red(Color c) { // NO_UCD (unused code)
    324324            return Utils.color_int2float(c.getRed());
    325325        }
     
    331331         * @see java.awt.Color#getGreen()
    332332         */
    333         public static float green(Color c) {
     333        public static float green(Color c) { // NO_UCD (unused code)
    334334            return Utils.color_int2float(c.getGreen());
    335335        }
     
    341341         * @see java.awt.Color#getBlue()
    342342         */
    343         public static float blue(Color c) {
     343        public static float blue(Color c) { // NO_UCD (unused code)
    344344            return Utils.color_int2float(c.getBlue());
    345345        }
     
    351351         * @see java.awt.Color#getAlpha()
    352352         */
    353         public static float alpha(Color c) {
     353        public static float alpha(Color c) { // NO_UCD (unused code)
    354354            return Utils.color_int2float(c.getAlpha());
    355355        }
     
    362362         */
    363363        @NullableArguments
    364         public static String concat(Object... args) {
     364        public static String concat(Object... args) { // NO_UCD (unused code)
    365365            return Utils.join("", Arrays.asList(args));
    366366        }
     
    373373         */
    374374        @NullableArguments
    375         public static String join(String... args) {
     375        public static String join(String... args) { // NO_UCD (unused code)
    376376            return Utils.join(args[0], Arrays.asList(args).subList(1, args.length));
    377377        }
     
    384384         * @see Utils#join
    385385         */
    386         public static String join_list(final String separator, final List<String> values) {
     386        public static String join_list(final String separator, final List<String> values) { // NO_UCD (unused code)
    387387            return Utils.join(separator, values);
    388388        }
     
    394394         * @return the property value
    395395         */
    396         public static Object prop(final Environment env, String key) {
     396        public static Object prop(final Environment env, String key) { // NO_UCD (unused code)
    397397            return prop(env, key, null);
    398398        }
     
    415415         * @return {@code true} if the property is set, {@code false} otherwise
    416416         */
    417         public static Boolean is_prop_set(final Environment env, String key) {
     417        public static Boolean is_prop_set(final Environment env, String key) { // NO_UCD (unused code)
    418418            return is_prop_set(env, key, null);
    419419        }
     
    436436         * @return the value for given key
    437437         */
    438         public static String tag(final Environment env, String key) {
     438        public static String tag(final Environment env, String key) { // NO_UCD (unused code)
    439439            return env.osm == null ? null : env.osm.get(key);
    440440        }
     
    446446         * @return first non-null value of the key {@code key} from the object's parent(s)
    447447         */
    448         public static String parent_tag(final Environment env, String key) {
     448        public static String parent_tag(final Environment env, String key) { // NO_UCD (unused code)
    449449            if (env.parent == null) {
    450450                if (env.osm != null) {
     
    470470         * @return a list of non-null values of the key {@code key} from the object's parent(s)
    471471         */
    472         public static List<String> parent_tags(final Environment env, String key) {
     472        public static List<String> parent_tags(final Environment env, String key) { // NO_UCD (unused code)
    473473            if (env.parent == null) {
    474474                if (env.osm != null) {
     
    494494         * @return the value of the key {@code key} from the object's child, or {@code null} if there is no child
    495495         */
    496         public static String child_tag(final Environment env, String key) {
     496        public static String child_tag(final Environment env, String key) { // NO_UCD (unused code)
    497497            return env.child == null ? null : env.child.get(key);
    498498        }
     
    504504         * @return {@code true} if the object has a tag with the given key, {@code false} otherwise
    505505         */
    506         public static boolean has_tag_key(final Environment env, String key) {
     506        public static boolean has_tag_key(final Environment env, String key) { // NO_UCD (unused code)
    507507            return env.osm.hasKey(key);
    508508        }
     
    513513         * @return the index as float. Starts at 1
    514514         */
    515         public static Float index(final Environment env) {
     515        public static Float index(final Environment env) { // NO_UCD (unused code)
    516516            if (env.index == null) {
    517517                return null;
     
    526526         * @see Environment#getRole()
    527527         */
    528         public static String role(final Environment env) {
     528        public static String role(final Environment env) { // NO_UCD (unused code)
    529529            return env.getRole();
    530530        }
     
    536536         * @see Geometry#computeArea(OsmPrimitive)
    537537         */
    538         public static Float areasize(final Environment env) {
     538        public static Float areasize(final Environment env) { // NO_UCD (unused code)
    539539            final Double area = Geometry.computeArea(env.osm);
    540540            return area == null ? null : area.floatValue();
     
    547547         * @see Way#getLength()
    548548         */
    549         public static Float waylength(final Environment env) {
     549        public static Float waylength(final Environment env) { // NO_UCD (unused code)
    550550            if (env.osm instanceof Way) {
    551551                return (float) ((Way) env.osm).getLength();
     
    560560         * @return {@code true} if {@code !b}
    561561         */
    562         public static boolean not(boolean b) {
     562        public static boolean not(boolean b) { // NO_UCD (unused code)
    563563            return !b;
    564564        }
     
    570570         * @return {@code true} if {@code a &gt;= b}
    571571         */
    572         public static boolean greater_equal(float a, float b) {
     572        public static boolean greater_equal(float a, float b) { // NO_UCD (unused code)
    573573            return a >= b;
    574574        }
     
    580580         * @return {@code true} if {@code a &lt;= b}
    581581         */
    582         public static boolean less_equal(float a, float b) {
     582        public static boolean less_equal(float a, float b) { // NO_UCD (unused code)
    583583            return a <= b;
    584584        }
     
    590590         * @return {@code true} if {@code a &gt; b}
    591591         */
    592         public static boolean greater(float a, float b) {
     592        public static boolean greater(float a, float b) { // NO_UCD (unused code)
    593593            return a > b;
    594594        }
     
    600600         * @return {@code true} if {@code a &lt; b}
    601601         */
    602         public static boolean less(float a, float b) {
     602        public static boolean less(float a, float b) { // NO_UCD (unused code)
    603603            return a < b;
    604604        }
     
    610610         * @see Math#toRadians(double)
    611611         */
    612         public static double degree_to_radians(double degree) {
     612        public static double degree_to_radians(double degree) { // NO_UCD (unused code)
    613613            return Math.toRadians(degree);
    614614        }
     
    623623         * @see RotationAngle#parseCardinalRotation(String)
    624624         */
    625         public static Double cardinal_to_radians(String cardinal) {
     625        public static Double cardinal_to_radians(String cardinal) { // NO_UCD (unused code)
    626626            try {
    627627                return RotationAngle.parseCardinalRotation(cardinal);
     
    651651         * @see Object#equals(Object)
    652652         */
    653         public static boolean not_equal(Object a, Object b) {
     653        public static boolean not_equal(Object a, Object b) { // NO_UCD (unused code)
    654654            return !equal(a, b);
    655655        }
     
    662662         * @see SearchCompiler
    663663         */
    664         public static Boolean JOSM_search(final Environment env, String searchStr) {
     664        public static Boolean JOSM_search(final Environment env, String searchStr) { // NO_UCD (unused code)
    665665            Match m;
    666666            try {
     
    680680         * @return value for key, or default value if not found
    681681         */
    682         public static String JOSM_pref(Environment env, String key, String def) {
     682        public static String JOSM_pref(Environment env, String key, String def) { // NO_UCD (unused code)
    683683            return MapPaintStyles.getStyles().getPreferenceCached(key, def);
    684684        }
     
    692692         * @since 5699
    693693         */
    694         public static boolean regexp_test(String pattern, String target) {
     694        public static boolean regexp_test(String pattern, String target) { // NO_UCD (unused code)
    695695            return Pattern.matches(pattern, target);
    696696        }
     
    707707         * @since 5699
    708708         */
    709         public static boolean regexp_test(String pattern, String target, String flags) {
     709        public static boolean regexp_test(String pattern, String target, String flags) { // NO_UCD (unused code)
    710710            int f = 0;
    711711            if (flags.contains("i")) {
     
    734734         * @since 5701
    735735         */
    736         public static List<String> regexp_match(String pattern, String target, String flags) {
     736        public static List<String> regexp_match(String pattern, String target, String flags) { // NO_UCD (unused code)
    737737            int f = 0;
    738738            if (flags.contains("i")) {
     
    757757         * @since 5701
    758758         */
    759         public static List<String> regexp_match(String pattern, String target) {
     759        public static List<String> regexp_match(String pattern, String target) { // NO_UCD (unused code)
    760760            return Utils.getMatches(Pattern.compile(pattern).matcher(target));
    761761        }
     
    767767         * @see OsmPrimitive#getUniqueId()
    768768         */
    769         public static long osm_id(final Environment env) {
     769        public static long osm_id(final Environment env) { // NO_UCD (unused code)
    770770            return env.osm.getUniqueId();
    771771        }
     
    778778         */
    779779        @NullableArguments
    780         public static String tr(String... args) {
     780        public static String tr(String... args) { // NO_UCD (unused code)
    781781            final String text = args[0];
    782782            System.arraycopy(args, 1, args, 0, args.length - 1);
     
    791791         * @see String#substring(int)
    792792         */
    793         public static String substring(String s, /* due to missing Cascade.convertTo for int*/ float begin) {
     793        public static String substring(String s, /* due to missing Cascade.convertTo for int*/ float begin) { // NO_UCD (unused code)
    794794            return s == null ? null : s.substring((int) begin);
    795795        }
     
    804804         * @see String#substring(int, int)
    805805         */
    806         public static String substring(String s, float begin, float end) {
     806        public static String substring(String s, float begin, float end) { // NO_UCD (unused code)
    807807            return s == null ? null : s.substring((int) begin, (int) end);
    808808        }
     
    816816         * @see String#replace(CharSequence, CharSequence)
    817817         */
    818         public static String replace(String s, String target, String replacement) {
     818        public static String replace(String s, String target, String replacement) { // NO_UCD (unused code)
    819819            return s == null ? null : s.replace(target, replacement);
    820820        }
     
    827827         * @return the encoded string
    828828         */
    829         public static String URL_encode(String s) {
     829        public static String URL_encode(String s) { // NO_UCD (unused code)
    830830            return s == null ? null : Utils.encodeUrl(s);
    831831        }
     
    838838         * @return the encoded string
    839839         */
    840         public static String XML_encode(String s) {
     840        public static String XML_encode(String s) { // NO_UCD (unused code)
    841841            return s == null ? null : XmlWriter.encode(s);
    842842        }
     
    847847         * @return long value from 0 to 2^32-1
    848848         */
    849         public static long CRC32_checksum(String s) {
     849        public static long CRC32_checksum(String s) { // NO_UCD (unused code)
    850850            CRC32 cs = new CRC32();
    851851            cs.update(s.getBytes(StandardCharsets.UTF_8));
     
    903903         */
    904904        @NullableArguments
    905         public static Object print(Object o) {
     905        public static Object print(Object o) { // NO_UCD (unused code)
    906906            System.out.print(o == null ? "none" : o.toString());
    907907            return o;
     
    915915         */
    916916        @NullableArguments
    917         public static Object println(Object o) {
     917        public static Object println(Object o) { // NO_UCD (unused code)
    918918            System.out.println(o == null ? "none" : o.toString());
    919919            return o;
     
    925925         * @return number of tags
    926926         */
    927         public static int number_of_tags(Environment env) {
     927        public static int number_of_tags(Environment env) { // NO_UCD (unused code)
    928928            return env.osm.getNumKeys();
    929929        }
     
    935935         * @return the value of the setting (calculated when the style is loaded)
    936936         */
    937         public static Object setting(Environment env, String key) {
     937        public static Object setting(Environment env, String key) { // NO_UCD (unused code)
    938938            return env.source.settingValues.get(key);
    939939        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r9253 r9983  
    955955    }
    956956
    957     public Action getAction(String s) {
    958         Action e = actions.get(s);
    959         if (e == null) {
    960             e = regactions.get(s);
    961         }
    962         return e;
    963     }
    964 
    965957    private void loadActions() {
    966958        rootActionsNode.removeAllChildren();
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r9847 r9983  
    1212import java.awt.event.ActionEvent;
    1313import java.awt.event.KeyEvent;
    14 import java.awt.event.KeyListener;
    1514import java.beans.PropertyChangeEvent;
    1615import java.beans.PropertyChangeListener;
     
    487486    }
    488487
    489     public void addOKAccelatorListener(KeyListener l) {
    490         addKeyListener(l);
    491         if (editor != null) {
    492             editor.getEditor().addKeyListener(l);
    493         }
    494     }
    495 
    496488    /**
    497489     * Inject a tag cell editor in the tag table
  • trunk/src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java

    r9854 r9983  
    1717
    1818    private final int maxSize;
    19 
    20     private final transient List<HistoryChangedListener> listeners = new ArrayList<>();
    2119
    2220    /**
     
    6361        // set selected item to the one just added
    6462        setSelectedItem(o);
    65 
    66         fireHistoryChanged();
    6763    }
    6864
     
    116112        return list;
    117113    }
    118 
    119     public void addHistoryChangedListener(HistoryChangedListener l) {
    120         listeners.add(l);
    121     }
    122 
    123     public void removeHistoryChangedListener(HistoryChangedListener l) {
    124         listeners.remove(l);
    125     }
    126 
    127     private void fireHistoryChanged() {
    128         for (HistoryChangedListener l : listeners) {
    129             l.historyChanged(asStringList());
    130         }
    131     }
    132114}
  • trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java

    r9455 r9983  
    2929     * @param layer GeoImage layer to export
    3030     */
    31     public GeoImageSessionExporter(GeoImageLayer layer) {
     31    public GeoImageSessionExporter(GeoImageLayer layer) { // NO_UCD (unused code)
    3232        super(layer);
    3333    }
  • trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java

    r9471 r9983  
    2121     * @param layer GPX layer to export
    2222     */
    23     public GpxTracksSessionExporter(GpxLayer layer) {
     23    public GpxTracksSessionExporter(GpxLayer layer) { // NO_UCD (test only)
    2424        super(layer, "tracks", "0.1", "gpx");
    2525    }
  • trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java

    r9455 r9983  
    3333     * @param layer imagery layer to export
    3434     */
    35     public ImagerySessionExporter(ImageryLayer layer) {
     35    public ImagerySessionExporter(ImageryLayer layer) { // NO_UCD (unused code)
    3636        super(layer);
    3737    }
     
    4141     * @param layer TMS layer to export
    4242     */
    43     public ImagerySessionExporter(TMSLayer layer) {
     43    public ImagerySessionExporter(TMSLayer layer) { // NO_UCD (unused code)
    4444        super(layer);
    4545    }
     
    4949     * @param layer WMS layer to export
    5050     */
    51     public ImagerySessionExporter(WMSLayer layer) {
     51    public ImagerySessionExporter(WMSLayer layer) { // NO_UCD (unused code)
    5252        super(layer);
    5353    }
     
    5757     * @param layer WMTS layer to export
    5858     */
    59     public ImagerySessionExporter(WMTSLayer layer) {
     59    public ImagerySessionExporter(WMTSLayer layer) { // NO_UCD (unused code)
    6060        super(layer);
    6161    }
  • trunk/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java

    r9455 r9983  
    3737     * @param layer marker layer to export
    3838     */
    39     public MarkerSessionExporter(MarkerLayer layer) {
     39    public MarkerSessionExporter(MarkerLayer layer) { // NO_UCD (unused code)
    4040        super(layer);
    4141    }
  • trunk/src/org/openstreetmap/josm/io/session/NoteSessionExporter.java

    r9746 r9983  
    1818     * @param layer Note layer to export
    1919     */
    20     public NoteSessionExporter(NoteLayer layer) {
     20    public NoteSessionExporter(NoteLayer layer) { // NO_UCD (unused code)
    2121        super(layer, "osm-notes", "0.1", "osn");
    2222    }
  • trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java

    r9471 r9983  
    2222     * @param layer Data layer to export
    2323     */
    24     public OsmDataSessionExporter(OsmDataLayer layer) {
     24    public OsmDataSessionExporter(OsmDataLayer layer) { // NO_UCD (test only)
    2525        super(layer, "osm-data", "0.1", "osm");
    2626    }
  • trunk/src/org/openstreetmap/josm/plugins/PluginException.java

    r8308 r9983  
    1313public class PluginException extends Exception {
    1414    public final transient PluginProxy plugin;
    15     public final String name;
    1615
    1716    public PluginException(PluginProxy plugin, String name, Throwable cause) {
    1817        super(tr("An error occurred in plugin {0}", name), cause);
    1918        this.plugin = plugin;
    20         this.name = name;
    2119    }
    2220
    23     public PluginException(String name, String message) {
     21    public PluginException(String message) {
    2422        super(message);
    2523        this.plugin = null;
    26         this.name = name;
    2724    }
    2825
     
    3027        super(tr("An error occurred in plugin {0}", name), cause);
    3128        this.plugin = null;
    32         this.name = name;
    3329    }
    3430}
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r8943 r9983  
    111111    public PluginInformation(File file, String name) throws PluginException {
    112112        if (!PluginHandler.isValidJar(file)) {
    113             throw new PluginException(name, tr("Invalid jar file ''{0}''", file));
     113            throw new PluginException(tr("Invalid jar file ''{0}''", file));
    114114        }
    115115        this.name = name;
     
    121121            Manifest manifest = jar.getManifest();
    122122            if (manifest == null)
    123                 throw new PluginException(name, tr("The plugin file ''{0}'' does not include a Manifest.", file.toString()));
     123                throw new PluginException(tr("The plugin file ''{0}'' does not include a Manifest.", file.toString()));
    124124            scanManifest(manifest, false);
    125125            libraries.add(0, Utils.fileToURL(file));
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r9599 r9983  
    9595    private static volatile PluralMode pluralMode = PluralMode.MODE_NOTONE; /* english default */
    9696    private static volatile String loadedCode = "en";
    97     /** store the original system locale for further use */
    98     public static final Locale SystemLocale = Locale.getDefault();
    9997
    10098    /* Localization keys for file chooser (and color chooser). */
  • trunk/src/org/openstreetmap/josm/tools/Pair.java

    r9542 r9983  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.tools;
    3 import java.util.ArrayList;
    4 import java.util.List;
    53import java.util.Objects;
    64
     
    4846
    4947    /**
    50      * Converts a single-typed pair to a list.
    51      * @param <T> type of both elements
    52      * @param p pair
    53      * @return list containing a and b
    54      */
    55     public static <T> List<T> toList(Pair<T, T> p) {
    56         List<T> l = new ArrayList<>(2);
    57         l.add(p.a);
    58         l.add(p.b);
    59         return l;
    60     }
    61 
    62     /**
    6348     * Sorts a single-typed pair so {@code a <= b}.
    6449     * @param <T> type of both elements
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r9799 r9983  
    239239    public XmlObjectParser() {
    240240        parser = new Parser();
    241     }
    242 
    243     public XmlObjectParser(DefaultHandler handler) {
    244         parser = handler;
    245241    }
    246242
Note: See TracChangeset for help on using the changeset viewer.