Changeset 7759 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2014-12-01T20:08:41+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #10798 - throw exception with invalid imagery types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r7476 r7759  
    301301    }
    302302
     303    /**
     304     * Constructs a new {@code ImageryInfo} with given name, url, extended and EULA URLs.
     305     * @param name The entry name
     306     * @param url The entry URL
     307     * @param type The entry imagery type. If null, WMS will be used as default
     308     * @param eulaAcceptanceRequired The EULA URL
     309     * @throws IllegalArgumentException if type refers to an unknown imagery type
     310     */
    303311    public ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies) {
    304312        this.name=name;
     
    309317        if (t != null) {
    310318            this.imageryType = t;
     319        } else if (type != null && !type.trim().isEmpty()) {
     320            throw new IllegalArgumentException("unknown type: "+type);
    311321        }
    312322    }
Note: See TracChangeset for help on using the changeset viewer.