Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (11 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/AbstractParser.java

    r8390 r8510  
    4747        try {
    4848            l = Long.parseLong(v);
    49         } catch(NumberFormatException e) {
     49        } catch (NumberFormatException e) {
    5050            throwException(tr("Illegal value for mandatory attribute ''{0}'' of type long. Got ''{1}''.", name, v), e);
    5151        }
     
    6363        try {
    6464            l = Long.valueOf(v);
    65         } catch(NumberFormatException e) {
     65        } catch (NumberFormatException e) {
    6666            throwException(tr("Illegal value for mandatory attribute ''{0}'' of type long. Got ''{1}''.", name, v), e);
    6767        }
     
    8080        try {
    8181            d = Double.parseDouble(v);
    82         } catch(NumberFormatException e) {
     82        } catch (NumberFormatException e) {
    8383            throwException(tr("Illegal value for attribute ''{0}'' of type double. Got ''{1}''.", name, v), e);
    8484        }
     
    106106
    107107    protected final HistoryOsmPrimitive createPrimitive(Attributes atts, OsmPrimitiveType type) throws SAXException {
    108         long id = getMandatoryAttributeLong(atts,"id");
    109         long version = getMandatoryAttributeLong(atts,"version");
    110         long changesetId = getMandatoryAttributeLong(atts,"changeset");
    111         boolean visible= getMandatoryAttributeBoolean(atts, "visible");
     108        long id = getMandatoryAttributeLong(atts, "id");
     109        long version = getMandatoryAttributeLong(atts, "version");
     110        long changesetId = getMandatoryAttributeLong(atts, "changeset");
     111        boolean visible = getMandatoryAttributeBoolean(atts, "visible");
    112112
    113113        Long uid = getAttributeLong(atts, "uid");
     
    130130            Double lat = getAttributeDouble(atts, "lat");
    131131            Double lon = getAttributeDouble(atts, "lon");
    132             LatLon coor = (lat != null && lon != null) ? new LatLon(lat,lon) : null;
    133             primitive = new HistoryNode(
    134                     id,version,visible,user,changesetId,timestamp,coor
    135             );
     132            LatLon coor = (lat != null && lon != null) ? new LatLon(lat, lon) : null;
     133            primitive = new HistoryNode(id, version, visible, user, changesetId, timestamp, coor);
    136134
    137135        } else if (type.equals(OsmPrimitiveType.WAY)) {
    138             primitive = new HistoryWay(
    139                     id,version,visible,user,changesetId,timestamp
    140             );
     136            primitive = new HistoryWay(id, version, visible, user, changesetId, timestamp);
    141137        } else if (type.equals(OsmPrimitiveType.RELATION)) {
    142             primitive = new HistoryRelation(
    143                     id,version,visible,user,changesetId,timestamp
    144             );
     138            primitive = new HistoryRelation(id, version, visible, user, changesetId, timestamp);
    145139        }
    146140        return primitive;
     
    162156        String key = getMandatoryAttributeString(atts, "k");
    163157        String value = getMandatoryAttributeString(atts, "v");
    164         currentPrimitive.put(key,value);
     158        currentPrimitive.put(key, value);
    165159    }
    166160
    167161    protected final void handleNodeReference(Attributes atts) throws SAXException {
    168162        long ref = getMandatoryAttributeLong(atts, "ref");
    169         ((HistoryWay)currentPrimitive).addNode(ref);
     163        ((HistoryWay) currentPrimitive).addNode(ref);
    170164    }
    171165
     
    176170        try {
    177171            type = OsmPrimitiveType.fromApiTypeName(v);
    178         } catch(IllegalArgumentException e) {
     172        } catch (IllegalArgumentException e) {
    179173            throwException(tr("Illegal value for mandatory attribute ''{0}'' of type OsmPrimitiveType. Got ''{1}''.", "type", v), e);
    180174        }
    181175        String role = getMandatoryAttributeString(atts, "role");
    182         RelationMemberData member = new RelationMemberData(role, type,ref);
    183         ((HistoryRelation)currentPrimitive).addMember(member);
     176        RelationMemberData member = new RelationMemberData(role, type, ref);
     177        ((HistoryRelation) currentPrimitive).addMember(member);
    184178    }
    185179
Note: See TracChangeset for help on using the changeset viewer.