Ignore:
Timestamp:
2016-02-25T01:51:43+01:00 (8 years ago)
Author:
Don-vip
Message:

remove unused code, add unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java

    r9241 r9881  
    7171        this.targetLayer = targetLayer;
    7272        parents = new DataSet();
    73     }
    74 
    75     /**
    76      * constructor
    77      *
    78      * @param targetLayer  the target layer for the downloaded primitives. Must not be null.
    79      * @param children  the collection of children for which parents are to be downloaded. Children
    80      * are specified by their id and  their type.
    81      */
    82     public DownloadReferrersTask(OsmDataLayer targetLayer, Map<Long, OsmPrimitiveType> children) {
    83         super("Download referrers", false /* don't ignore exception*/);
    84         CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer");
    85         canceled = false;
    86         this.children = new HashMap<>();
    87         if (children != null) {
    88             for (Entry<Long, OsmPrimitiveType> entry : children.entrySet()) {
    89                 if (entry.getKey() > 0 && entry.getValue() != null) {
    90                     children.put(entry.getKey(), entry.getValue());
    91                 }
    92             }
    93         }
    94         this.targetLayer = targetLayer;
    95         parents = new DataSet();
    96     }
    97 
    98     /**
    99      * constructor
    100      *
    101      * @param targetLayer  the target layer. Must not be null.
    102      * @param id the primitive id. id &gt; 0 required.
    103      * @param type the primitive type. type != null required
    104      * @throws IllegalArgumentException if id &lt;= 0
    105      * @throws IllegalArgumentException if type == null
    106      * @throws IllegalArgumentException if targetLayer == null
    107      */
    108     public DownloadReferrersTask(OsmDataLayer targetLayer, long id, OsmPrimitiveType type) {
    109         super("Download referrers", false /* don't ignore exception*/);
    110         CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer");
    111         if (id <= 0)
    112             throw new IllegalArgumentException(MessageFormat.format("Id > 0 required, got {0}", id));
    113         CheckParameterUtil.ensureParameterNotNull(type, "type");
    114         canceled = false;
    115         this.children = new HashMap<>();
    116         this.children.put(id, type);
    117         this.targetLayer = targetLayer;
    118         parents = new DataSet();
    119     }
    120 
    121     /**
    122      * constructor
    123      *
    124      * @param targetLayer the target layer. Must not be null.
    125      * @param primitiveId a PrimitiveId object.
    126      * @throws IllegalArgumentException if id &lt;= 0
    127      * @throws IllegalArgumentException if targetLayer == null
    128      */
    129     public DownloadReferrersTask(OsmDataLayer targetLayer, PrimitiveId primitiveId) {
    130         this(targetLayer,  primitiveId, null);
    13173    }
    13274
Note: See TracChangeset for help on using the changeset viewer.