Changeset 14169 in josm for trunk/src


Ignore:
Timestamp:
2018-08-19T23:48:04+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #16575 - make sure download/upload policies are never null and set to normal by default

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

Legend:

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

    r14120 r14169  
    134134
    135135    private String name;
    136     private DownloadPolicy downloadPolicy;
    137     private UploadPolicy uploadPolicy;
     136    private DownloadPolicy downloadPolicy = DownloadPolicy.NORMAL;
     137    private UploadPolicy uploadPolicy = UploadPolicy.NORMAL;
    138138    /** Flag used to know if the dataset should not be editable */
    139139    private final AtomicBoolean isReadOnly = new AtomicBoolean(false);
     
    329329    @Override
    330330    public void setDownloadPolicy(DownloadPolicy downloadPolicy) {
    331         this.downloadPolicy = downloadPolicy;
     331        this.downloadPolicy = Objects.requireNonNull(downloadPolicy);
    332332    }
    333333
     
    339339    @Override
    340340    public void setUploadPolicy(UploadPolicy uploadPolicy) {
    341         this.uploadPolicy = uploadPolicy;
     341        this.uploadPolicy = Objects.requireNonNull(uploadPolicy);
    342342    }
    343343
  • trunk/src/org/openstreetmap/josm/data/osm/OsmData.java

    r13925 r14169  
    229229    /**
    230230     * Sets the download policy.
    231      * @param downloadPolicy the download policy
     231     * @param downloadPolicy the download policy. Must not be null
    232232     * @see #getUploadPolicy()
    233233     * @since 13453
     
    244244    /**
    245245     * Sets the upload policy.
    246      * @param uploadPolicy the upload policy
     246     * @param uploadPolicy the upload policy. Must not be null
    247247     * @see #getUploadPolicy()
    248248     */
Note: See TracChangeset for help on using the changeset viewer.