Opened 11 years ago

Last modified 11 years ago

#11427 closed defect

BingAerialTileSource - NullPointerException in Constructor — at Version 2

Reported by: rfu@… Owned by: The111
Priority: normal Milestone:
Component: JMapViewer Version:
Keywords: NullPointerException Cc: wiktorn

Description (last modified by bastiK)

SVN version 31122

TileSource bingAerial = new BingAerialTileSource();

[...]

public class BingAerialTileSource extends AbstractTMSTileSource {
    /**
     * Constructs a new {@code BingAerialTileSource}.
     */
    public BingAerialTileSource() {
        super(new TileSourceInfo("Bing", null, null)); // base_url = NULL!!
    }

}

public abstract class AbstractTMSTileSource extends AbstractTileSource {
    public AbstractTMSTileSource(TileSourceInfo info) {
        this.name = info.getName();
        this.baseUrl = info.getUrl(); 
        if(baseUrl.endsWith("/")) {         // ***** baseUrl is NULL!! *********
            baseUrl = baseUrl.substring(0,baseUrl.length()-1);
        }
        this.id = info.getUrl();
        this.noTileHeaders = info.getNoTileHeaders();
    }

}

Change History (3)

comment:1 by bastiK, 11 years ago

Cc: wiktorn added

comment:2 by bastiK, 11 years ago

Description: modified (diff)

by wiktorn, 11 years ago

Attachment: 11427_Bing_NPE.patch added

Good point

Note: See TracTickets for help on using tickets.