Changeset 9997 in josm for trunk


Ignore:
Timestamp:
2016-03-15T02:16:30+01:00 (9 years ago)
Author:
Don-vip
Message:

sonar - various fixes + javadoc

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java

    r9921 r9997  
    137137
    138138    /**
    139      * Protected constructor for subclasses to use.
    140      *
    141      * @param allowLocal Should local addresses be considered valid?
    142      */
    143     protected EmailValidator(boolean allowLocal) {
    144         super();
    145         this.allowLocal = allowLocal;
    146         this.allowTld = false;
    147     }
    148 
    149     /**
    150139     * <p>Checks if a field has a valid e-mail address.</p>
    151140     *
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r9799 r9997  
    1616import java.util.Collection;
    1717import java.util.HashMap;
     18import java.util.HashSet;
    1819import java.util.List;
    1920import java.util.Locale;
     
    128129    protected static final int MISSPELLED_KEY    = 1213;
    129130    protected static final int MULTIPLE_SPACES   = 1214;
    130     /** 1250 and up is used by tagcheck */
     131    // 1250 and up is used by tagcheck
    131132
    132133    protected EditableList sourcesList;
    133134
    134     private static final List<String> DEFAULT_SOURCES = Arrays.asList(/*DATA_FILE, */IGNORE_FILE, SPELL_FILE);
     135    private static final Set<String> DEFAULT_SOURCES = new HashSet<>(Arrays.asList(/*DATA_FILE, */IGNORE_FILE, SPELL_FILE));
    135136
    136137    /**
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r9996 r9997  
    131131
    132132    // Toggle dialogs
     133
     134    /** Conflict dialog */
    133135    public ConflictDialog conflictDialog;
     136    /** Filter dialog */
    134137    public FilterDialog filterDialog;
     138    /** Relation list dialog */
    135139    public RelationListDialog relationListDialog;
     140    /** Validator dialog */
    136141    public ValidatorDialog validatorDialog;
     142    /** Selection list dialog */
    137143    public SelectionListDialog selectionListDialog;
     144    /** Properties dialog */
    138145    public PropertiesDialog propertiesDialog;
     146    /** Map paint dialog */
    139147    public MapPaintDialog mapPaintDialog;
     148    /** Notes dialog */
    140149    public NotesDialog noteDialog;
    141150
    142151    // Map modes
     152
     153    /** Select mode */
    143154    public final SelectAction mapModeSelect;
     155    /** Draw mode */
    144156    public final DrawAction mapModeDraw;
     157    /** Zoom mode */
    145158    public final ZoomAction mapModeZoom;
     159    /** Select Lasso mode */
    146160    public LassoModeAction mapModeSelectLasso;
    147161
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java

    r9668 r9997  
    66import java.beans.PropertyChangeListener;
    77import java.beans.PropertyChangeSupport;
    8 import java.lang.reflect.Constructor;
    98import java.lang.reflect.Method;
    109import java.util.ArrayList;
     
    105104                Boolean canEdit = (Boolean) m.invoke(null, r);
    106105                if (canEdit) {
    107                     Constructor<RelationEditor> con = e.getConstructor(Relation.class, Collection.class);
    108                     return con.newInstance(layer, r, selectedMembers);
     106                    return e.getConstructor(Relation.class, Collection.class).newInstance(layer, r, selectedMembers);
    109107                }
    110108            } catch (Exception ex) {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r9880 r9997  
    13911391            } catch (NumberFormatException nfe) {
    13921392                // Invalid timezone
    1393                 throw new ParseException(error, 0);
     1393                throw (ParseException) new ParseException(error, 0).initCause(nfe);
    13941394            }
    13951395
     
    14591459                    return Offset.milliseconds(Math.round(Double.parseDouble(offset) * 1000));
    14601460                } catch (NumberFormatException nfe) {
    1461                     throw new ParseException(error, 0);
     1461                    throw (ParseException) new ParseException(error, 0).initCause(nfe);
    14621462                }
    14631463            } else {
  • trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java

    r9995 r9997  
    3838 *
    3939 * The certificates are added in-memory at each start, nothing is written to disk.
     40 * @since 9995
    4041 */
    41 public class CertificateAmendment {
     42public final class CertificateAmendment {
    4243
    43     public static final String[] CERT_AMEND = {
     44    private static final String[] CERT_AMEND = {
    4445        "resource://data/security/DST_Root_CA_X3.pem",
    4546        "resource://data/security/StartCom_Certification_Authority.pem"
    4647    };
    47     public static final String[] SHA_HASHES = {
     48
     49    private static final String[] SHA_HASHES = {
    4850        "139a5e4a4e0fa505378c72c5f700934ce8333f4e6b1b508886c4b0eb14f4be99",
    4951        "916a8f9232328192968c81c8edb672fa539f726861dfe379ca722050e19962cd"
    5052    };
     53
     54    private CertificateAmendment() {
     55        // Hide default constructor for utility classes
     56    }
    5157
    5258    /**
     
    8187        for (int i = 0; i < CERT_AMEND.length; i++) {
    8288            CachedFile certCF = new CachedFile(CERT_AMEND[i]);
    83             byte[] certBytes = certCF.getByteContent();
    8489            MessageDigest md;
    8590            try {
     
    8893                throw new RuntimeException(ex);
    8994            }
     95            byte[] certBytes = certCF.getByteContent();
    9096            byte[] sha = md.digest(certBytes);
    9197            if (!SHA_HASHES[i].equals(Utils.toHexString(sha)))
     
    131137     */
    132138    private static boolean certificateIsMissing(KeyStore keyStore, X509Certificate crt) {
    133         String id = crt.getSubjectX500Principal().getName();
    134139        PKIXParameters params;
    135140        try {
     
    140145            throw new RuntimeException(ex);
    141146        }
     147        String id = crt.getSubjectX500Principal().getName();
    142148        for (TrustAnchor ta : params.getTrustAnchors()) {
    143149            X509Certificate cert = ta.getTrustedCert();
  • trunk/src/org/openstreetmap/josm/tools/CopyList.java

    r9231 r9997  
    183183            } catch (IndexOutOfBoundsException e) {
    184184                checkForComodification();
    185                 throw new NoSuchElementException(e.getMessage());
     185                throw (NoSuchElementException) new NoSuchElementException(e.getMessage()).initCause(e);
    186186            }
    187187        }
  • trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java

    r9856 r9997  
    7272            return query;
    7373        } catch (NoSuchMethodException e) {
    74             throw new IllegalStateException();
     74            throw new IllegalStateException(e);
    7575        } catch (ScriptException e) {
    7676            throw new RuntimeException("Failed to execute OverpassTurboQueryWizard", e);
    7777        }
    7878    }
    79 
    8079}
  • trunk/src/org/openstreetmap/josm/tools/date/DateUtils.java

    r9823 r9997  
    137137            return XML_DATE.newXMLGregorianCalendar(str).toGregorianCalendar().getTimeInMillis();
    138138        } catch (Exception ex) {
    139             throw new UncheckedParseException("The date string (" + str + ") could not be parsed.");
     139            throw new UncheckedParseException("The date string (" + str + ") could not be parsed.", ex);
    140140        }
    141141    }
Note: See TracChangeset for help on using the changeset viewer.