Ignore:
Timestamp:
2019-03-24T15:58:25+01:00 (5 years ago)
Author:
donvip
Message:

fix warnings

Location:
applications/editors/josm/plugins/lakewalker
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/lakewalker/.settings/org.eclipse.jdt.core.prefs

    r32699 r34934  
    99org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
    1010org.eclipse.jdt.core.compiler.compliance=1.8
     11org.eclipse.jdt.core.compiler.doc.comment.support=enabled
    1112org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    1213org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     
    3233org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
    3334org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     35org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
     36org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
     37org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
     38org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
     39org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
    3440org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
    3541org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     
    3844org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
    3945org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     46org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
     47org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
     48org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
     49org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
     50org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
     51org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
     52org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
     53org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
    4054org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
    4155org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Configurer.java

    r32676 r34934  
    22package org.openstreetmap.josm.plugins.lakewalker;
    33
     4import java.awt.Component;
    45import java.beans.PropertyChangeListener;
    56
     
    1213 * */
    1314public abstract class Configurer {
    14 // FIXME: maybe parameterize this so that value can have the right type
    15 // in subclasses?
     15  // FIXME: maybe parameterize this so that value can have the right type in subclasses?
    1616  public static final String NAME_PROPERTY = "Configurer.name";
    17   //    public static final String VALUE_PROPERTY = "value";
    1817
    1918  /** A String the uniquely identifies this property */
     
    4443  /**
    4544   * Unique identifier
     45   * @return Unique identifier
    4646   */
    4747  public String getKey() {
     
    5151  /**
    5252   * Plain English description of the Object
     53   * @return Plain English description of the Object
    5354   */
    5455  public String getName() {
     
    6768   * The Object value
    6869   * May be null if the Object has not been initialized
     70   * @return The Object value
    6971   */
    7072  public Object getValue() {
     
    7981  /**
    8082   * Set the Object value
     83   * @param o the Object value
    8184   */
    8285  public void setValue(Object o) {
     
    9093  /**
    9194   * If true, then don't fire PropertyChangeEvents when the value is reset
     95   * @param val true to disable firing PropertyChangeEvents when the value is reset
    9296   */
    9397  public void setFrozen(boolean val) {
     
    108112  /**
    109113   * Set the Object value from a String
     114   * @param s Object value as String
    110115   */
    111116  public abstract void setValue(String s);
     
    113118  /**
    114119   * GUI interface for setting the option in an editing window
     120   * @return GUI interface for setting the option in an editing window
    115121   */
    116   public abstract java.awt.Component getControls();
     122  public abstract Component getControls();
    117123
    118124  /**
    119125   * Add a listener to be notified when the Object state changes
     126   * @param l listener to add
    120127   */
    121   public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
     128  public void addPropertyChangeListener(PropertyChangeListener l) {
    122129    changeSupport.addPropertyChangeListener(l);
    123130  }
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Lakewalker.java

    r32676 r34934  
    3535
    3636    /**
    37      *  east = 0
    38      *  northeast = 1
    39      *  north = 2
    40      *  northwest = 3
    41      *  west = 4
    42      *  southwest = 5
    43      *  south = 6
    44      *  southeast = 7
     37     * Map direction to index.
     38     * @param direction human direction: {@code (north|south)?(east|west)?}
     39     * @return direction index as follows:
     40     * <ul>
     41     * <li>east = 0</li>
     42     * <li>northeast = 1</li>
     43     * <li>north = 2</li>
     44     * <li>northwest = 3</li>
     45     * <li>west = 4</li>
     46     * <li>southwest = 5</li>
     47     * <li>south = 6</li>
     48     * <li>southeast = 7</li>
     49     * </ul>
    4550     */
    4651    private int getDirectionIndex(String direction) throws ArrayIndexOutOfBoundsException {
     
    7075    /**
    7176     * Do a trace
    72      */
    73     public ArrayList<double[]> trace(double lat, double lon, double tl_lon, double br_lon, double tl_lat, double br_lat,
     77     *
     78     * @param lat latitude
     79     * @param lon longitude
     80     * @param tl_lon top/left longitude
     81     * @param br_lon bottom/right longitude
     82     * @param tl_lat top/left latitude
     83     * @param br_lat bottom/right latitude
     84     * @param progressMonitor Progress monitor
     85     * @return list of node coordinates
     86     * @throws LakewalkerException if anything goes wrong
     87     */
     88    public List<double[]> trace(double lat, double lon, double tl_lon, double br_lon, double tl_lat, double br_lat,
    7489            ProgressMonitor progressMonitor) throws LakewalkerException {
    7590
     
    8398            Boolean detect_loop = false;
    8499
    85             ArrayList<double[]> nodelist = new ArrayList<>();
     100            List<double[]> nodelist = new ArrayList<>();
    86101
    87102            int[] xy = geo_to_xy(lat, lon, this.resolution);
     
    201216    /**
    202217     * Remove duplicate nodes from the list
    203      */
    204     public ArrayList<double[]> duplicateNodeRemove(ArrayList<double[]> nodes) {
     218     * @param nodes list of node coordinates
     219     * @return filtered list without duplicate nodes
     220     */
     221    public List<double[]> duplicateNodeRemove(List<double[]> nodes) {
    205222
    206223        if (nodes.size() <= 1) {
     
    228245    /**
    229246     * Reduce the number of vertices based on their proximity to each other
    230      */
    231     public ArrayList<double[]> vertexReduce(ArrayList<double[]> nodes, double proximity) {
     247     * @param nodes list of node coordinates
     248     * @param proximity proximity
     249     * @return reduced list
     250     */
     251    public List<double[]> vertexReduce(List<double[]> nodes, double proximity) {
    232252
    233253        // Check if node list is empty
     
    237257
    238258        double[] test_v = nodes.get(0);
    239         ArrayList<double[]> reducednodes = new ArrayList<>();
     259        List<double[]> reducednodes = new ArrayList<>();
    240260
    241261        double prox_sq = Math.pow(proximity, 2);
     
    267287    }
    268288
    269         /*
    270     public ArrayList<double[]> douglasPeuckerNR(ArrayList<double[]> nodes, double epsilon) {
     289    /*
     290    public List<double[]> douglasPeuckerNR(List<double[]> nodes, double epsilon) {
    271291        command_stack = [(0, len(nodes) - 1)]
    272292
     
    332352        */
    333353
    334     public ArrayList<double[]> douglasPeucker(ArrayList<double[]> nodes, double epsilon, int depth) {
     354    public List<double[]> douglasPeucker(List<double[]> nodes, double epsilon, int depth) {
    335355
    336356        // Check if node list is empty
     
    344364        double[] last = nodes.get(nodes.size()-1);
    345365
    346         ArrayList<double[]> new_nodes = new ArrayList<>();
     366        List<double[]> new_nodes = new ArrayList<>();
    347367
    348368        double d = 0;
     
    372392    }
    373393
    374     private ArrayList<double[]> sublist(ArrayList<double[]> l, int i, int f) throws ArrayIndexOutOfBoundsException {
    375         ArrayList<double[]> sub = new ArrayList<>();
     394    private List<double[]> sublist(List<double[]> l, int i, int f) throws ArrayIndexOutOfBoundsException {
     395        List<double[]> sub = new ArrayList<>();
    376396
    377397        if (f < i || i < 0 || f < 0 || f > l.size()) {
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java

    r34599 r34934  
    1616import java.util.Comparator;
    1717import java.util.LinkedList;
     18import java.util.List;
    1819
    1920import javax.swing.JOptionPane;
     
    164165        progressMonitor.beginTask(null, 3);
    165166        try {
    166             ArrayList<double[]> nodelist = new ArrayList<>();
     167            List<double[]> nodelist = new ArrayList<>();
    167168
    168169            try {
     
    173174            }
    174175
    175             System.out.println(nodelist.size()+" nodes generated");
    176 
    177             /**
    178             * Run the nodelist through a vertex reduction algorithm
    179             */
     176            // Run the nodelist through a vertex reduction algorithm
    180177
    181178            progressMonitor.subTask(tr("Running vertex reduction..."));
     
    183180            nodelist = lw.vertexReduce(nodelist, epsilon);
    184181
    185             //System.out.println("After vertex reduction "+nodelist.size()+" nodes remain.");
    186 
    187             /**
    188             * And then through douglas-peucker approximation
    189             */
     182            // And then through douglas-peucker approximation
    190183
    191184            progressMonitor.worked(1);
     
    194187            nodelist = lw.douglasPeucker(nodelist, epsilon, 0);
    195188
    196             //System.out.println("After Douglas-Peucker approximation "+nodelist.size()+" nodes remain.");
    197 
    198             /**
    199             * And then through a duplicate node remover
    200             */
     189            // And then through a duplicate node remover
    201190
    202191            progressMonitor.worked(1);
     
    205194            nodelist = lw.duplicateNodeRemove(nodelist);
    206195
    207             //System.out.println("After removing duplicate nodes, "+nodelist.size()+" nodes remain.");
    208 
    209 
    210196            // if for some reason (image loading failed, ...) nodelist is empty, no more processing required.
    211             if (nodelist.size() == 0) {
     197            if (nodelist.isEmpty()) {
    212198                return;
    213199            }
    214200
    215             /**
    216             * Turn the arraylist into osm nodes
    217             */
     201            // Turn the arraylist into osm nodes
    218202
    219203            Way way = new Way();
Note: See TracChangeset for help on using the changeset viewer.