Ignore:
Timestamp:
2014-11-25T23:51:45+01:00 (8 years ago)
Author:
Don-vip
Message:

fix some Sonar issues recently introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r7731 r7748  
    9191public class ImageProvider {
    9292
     93    private static final String HTTP_PROTOCOL  = "http://";
     94    private static final String HTTPS_PROTOCOL = "https://";
     95    private static final String WIKI_PROTOCOL  = "wiki://";
     96
    9397    /**
    9498     * Position of an overlay icon
     
    266270     * @since 7687
    267271     */
    268     static public Dimension getImageSizes(ImageSizes size) {
     272    public static Dimension getImageSizes(ImageSizes size) {
    269273        int sizeval;
    270274        switch(size) {
     
    458462     */
    459463    public void getInBackground(final ImageCallback callback) {
    460         if (name.startsWith("http://") || name.startsWith("wiki://")) {
     464        if (name.startsWith(HTTP_PROTOCOL) || name.startsWith(WIKI_PROTOCOL)) {
    461465            Runnable fetch = new Runnable() {
    462466                @Override
     
    486490     */
    487491    public void getInBackground(final ImageResourceCallback callback) {
    488         if (name.startsWith("http://") || name.startsWith("wiki://")) {
     492        if (name.startsWith(HTTP_PROTOCOL) || name.startsWith(WIKI_PROTOCOL)) {
    489493            Runnable fetch = new Runnable() {
    490494                @Override
     
    572576            ImageType type = name.toLowerCase().endsWith(".svg") ? ImageType.SVG : ImageType.OTHER;
    573577
    574             if (name.startsWith("http://") || name.startsWith("https://")) {
     578            if (name.startsWith(HTTP_PROTOCOL) || name.startsWith(HTTPS_PROTOCOL)) {
    575579                String url = name;
    576580                ImageResource ir = cache.get(url);
     
    581585                }
    582586                return ir;
    583             } else if (name.startsWith("wiki://")) {
     587            } else if (name.startsWith(WIKI_PROTOCOL)) {
    584588                ImageResource ir = cache.get(name);
    585589                if (ir != null) return ir;
     
    984988     * overlay must be transparent in the background.
    985989     * Also scaling is not cared about with current implementation.
     990     * @deprecated this method will be refactored
    986991     */
    987992    @Deprecated
Note: See TracChangeset for help on using the changeset viewer.