Ignore:
Timestamp:
2014-02-27T01:41:49+01:00 (10 years ago)
Author:
Don-vip
Message:

fix some Sonar issues (JLS order)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r6830 r6889  
    675675     * What to do, when the tags have changed by one of the tag-changing methods.
    676676     */
    677     abstract protected void keysChangedImpl(Map<String, String> originalKeys);
     677    protected abstract void keysChangedImpl(Map<String, String> originalKeys);
    678678
    679679    /**
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java

    r6362 r6889  
    3434public final class ChangesetCache implements PreferenceChangedListener{
    3535    /** the unique instance */
    36     static private final ChangesetCache instance = new ChangesetCache();
     36    private static final ChangesetCache instance = new ChangesetCache();
    3737
    3838    /**
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java

    r6084 r6889  
    2828    }
    2929
    30     final private Map<PrimitiveId, HistoryOsmPrimitive> primitives = new HashMap<PrimitiveId, HistoryOsmPrimitive>();
    31     final private Map<PrimitiveId, ChangesetModificationType> modificationTypes = new HashMap<PrimitiveId, ChangesetModificationType>();
     30    private final Map<PrimitiveId, HistoryOsmPrimitive> primitives = new HashMap<PrimitiveId, HistoryOsmPrimitive>();
     31    private final Map<PrimitiveId, ChangesetModificationType> modificationTypes = new HashMap<PrimitiveId, ChangesetModificationType>();
    3232
    3333    /**
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r6830 r6889  
    4040 * @author imi
    4141 */
    42 abstract public class OsmPrimitive extends AbstractPrimitive implements Comparable<OsmPrimitive>, TemplateEngineDataProvider {
     42public abstract class OsmPrimitive extends AbstractPrimitive implements Comparable<OsmPrimitive>, TemplateEngineDataProvider {
    4343    private static final String SPECIAL_VALUE_ID = "id";
    4444    private static final String SPECIAL_VALUE_LOCAL_NAME = "localname";
     
    119119     * @return the sub-list of OSM primitives of type <code>type</code>
    120120     */
    121     static public <T extends OsmPrimitive>  List<T> getFilteredList(Collection<OsmPrimitive> list, Class<T> type) {
     121    public static <T extends OsmPrimitive>  List<T> getFilteredList(Collection<OsmPrimitive> list, Class<T> type) {
    122122        if (list == null) return Collections.emptyList();
    123123        List<T> ret = new LinkedList<T>();
     
    141141     * @return the sub-set of OSM primitives of type <code>type</code>
    142142     */
    143     static public <T extends OsmPrimitive> Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) {
     143    public static <T extends OsmPrimitive> Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) {
    144144        Set<T> ret = new LinkedHashSet<T>();
    145145        if (set != null) {
     
    160160     * empty set if primitives is null or if there are no referring primitives
    161161     */
    162     static public Set<OsmPrimitive> getReferrer(Collection<? extends OsmPrimitive> primitives) {
     162    public static Set<OsmPrimitive> getReferrer(Collection<? extends OsmPrimitive> primitives) {
    163163        HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
    164164        if (primitives == null || primitives.isEmpty()) return ret;
     
    10771077     * @param visitor The visitor from which the visit() function must be called.
    10781078     */
    1079     abstract public void accept(Visitor visitor);
     1079    public abstract void accept(Visitor visitor);
    10801080
    10811081    /**
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveComparator.java

    r6380 r6889  
    1010/** Comparator, comparing by type and objects display names */
    1111public class OsmPrimitiveComparator implements Comparator<OsmPrimitive> {
    12     final private Map<OsmPrimitive, String> cache= new HashMap<OsmPrimitive, String>();
    13     final private DefaultNameFormatter df = DefaultNameFormatter.getInstance();
     12    private final Map<OsmPrimitive, String> cache= new HashMap<OsmPrimitive, String>();
     13    private final DefaultNameFormatter df = DefaultNameFormatter.getInstance();
    1414    public boolean relationsFirst = false;
    1515
     
    2626        String an = cachedName(a);
    2727        String bn = cachedName(b);
    28         // make sure display names starting with digits are the end of the
    29         // list
     28        // make sure display names starting with digits are the end of the list
    3029        if (Character.isDigit(an.charAt(0)) && Character.isDigit(bn.charAt(0)))
    3130            return an.compareTo(bn);
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java

    r4387 r6889  
    1919    MULTIPOLYGON (marktr(/* ICON(data/) */"multipolygon"), null, RelationData.class);
    2020
    21     private final static Collection<OsmPrimitiveType> DATA_VALUES = Arrays.asList(NODE, WAY, RELATION);
     21    private static final Collection<OsmPrimitiveType> DATA_VALUES = Arrays.asList(NODE, WAY, RELATION);
    2222
    2323    private final String apiTypeName;
  • trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java

    r5589 r6889  
    1717public abstract class PrimitiveData extends AbstractPrimitive {
    1818
     19    /**
     20     * Constructs a new {@code PrimitiveData}.
     21     */
    1922    public PrimitiveData() {
    2023        id = OsmPrimitive.generateUniqueId();
     
    5154
    5255    @SuppressWarnings("unchecked")
    53     static public <T extends PrimitiveData> List<T> getFilteredList(Collection<T> list, OsmPrimitiveType type) {
     56    public static <T extends PrimitiveData> List<T> getFilteredList(Collection<T> list, OsmPrimitiveType type) {
    5457        List<T> ret = new ArrayList<T>();
    5558        for(PrimitiveData p: list) {
  • trunk/src/org/openstreetmap/josm/data/osm/RelationToChildReference.java

    r5266 r6889  
    1414     * @return  a set of all {@link RelationToChildReference}s for a given child primitive
    1515     */
    16     static public Set<RelationToChildReference> getRelationToChildReferences(OsmPrimitive child) {
     16    public static Set<RelationToChildReference> getRelationToChildReferences(OsmPrimitive child) {
    1717        Set<Relation> parents = OsmPrimitive.getFilteredSet(child.getReferrers(), Relation.class);
    1818        Set<RelationToChildReference> references = new HashSet<RelationToChildReference>();
     
    3434     * primitives
    3535     */
    36     static public Set<RelationToChildReference> getRelationToChildReferences(Collection<? extends OsmPrimitive> children) {
     36    public static Set<RelationToChildReference> getRelationToChildReferences(Collection<? extends OsmPrimitive> children) {
    3737        Set<RelationToChildReference> references = new HashSet<RelationToChildReference>();
    3838        for (OsmPrimitive child: children) {
  • trunk/src/org/openstreetmap/josm/data/osm/User.java

    r6822 r6889  
    2525public final class User {
    2626
    27     static private AtomicLong uidCounter = new AtomicLong();
     27    private static AtomicLong uidCounter = new AtomicLong();
    2828
    2929    /**
     
    3131     */
    3232    private static Map<Long,User> userMap = new HashMap<Long,User>();
    33     private final static User anonymous = createLocalUser(tr("<anonymous>"));
     33    private static final User anonymous = createLocalUser(tr("<anonymous>"));
    3434
    3535    private static long getNextLocalUid() {
Note: See TracChangeset for help on using the changeset viewer.