Ignore:
Timestamp:
2014-10-19T01:27:04+02:00 (11 years ago)
Author:
donvip
Message:

[josm_plugins] fix java 7 warnings / global usage of try-with-resource

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/ExtraNameFormatHook.java

    r26802 r30738  
    1414
    1515    public String checkRelationTypeName( IRelation relation, String defaultName ) {
    16         return null;
     16    return null;
    1717    }
    1818
    1919    public String checkFormat( INode node, String defaultName ) {
    20         return null;
     20    return null;
    2121    }
    2222
    2323    public String checkFormat( IWay way, String defaultName ) {
    24         if( way.get("place") != null && way.get("name") == null && way.get("place_name") != null )
    25             return way.get("place_name") + " " + defaultName;
    26         return null;
     24    if( way.get("place") != null && way.get("name") == null && way.get("place_name") != null )
     25        return way.get("place_name") + " " + defaultName;
     26    return null;
    2727    }
    2828
    2929    public String checkFormat( IRelation relation, String defaultName ) {
    30         String type = relation.get("type");
    31         if( type != null ) {
    32             String name = relation.get("destination");
    33             if( type.equals("destination_sign") && name != null ) {
    34                 if( relation.get("distance") != null )
    35                     name += " " + relation.get("distance");
    36                 if( defaultName.indexOf('"') < 0 )
    37                     return '"' + name + "\" " + defaultName;
    38                 else
    39                     return defaultName.replaceFirst("\".?+\"", '"'+name+'"');
    40             }
    41         }
    42         return null;
     30    String type = relation.get("type");
     31    if( type != null ) {
     32        String name = relation.get("destination");
     33        if( type.equals("destination_sign") && name != null ) {
     34        if( relation.get("distance") != null )
     35            name += " " + relation.get("distance");
     36        if( defaultName.indexOf('"') < 0 )
     37            return '"' + name + "\" " + defaultName;
     38        else
     39            return defaultName.replaceFirst("\".?+\"", '"'+name+'"');
     40        }
     41    }
     42    return null;
    4343    }
    4444}
Note: See TracChangeset for help on using the changeset viewer.