GMLDataStoreFactory using == for String compare

Description

In the testURL method of the GMLDataStoreFactory it's using == to check the protocol of the URL that's passed in. It should instead be using .equals for that check. Under some circumstances this can cause all GML data to fail to load.

@@ -106,7 +106,7 @@
}
}
public boolean testURL( URL f ) throws IOException {

  • if( f.getProtocol() == "file"){
    + if( "file".equals( f.getProtocol() ) )
    Unknown macro: { if(f.getFile().toUpperCase().endsWith(".XML&quot){
    return true;
    }@@ -115,7 +115,7 @@ }
    throw new IOException("*.xml or *.gml file required");
    }
    * if( f.getProtocol() == "http"){
    + if( "http".equals( f.getProtocol() ) ){
    URLConnection conn = f.openConnection();
    if( "text/xml".equals( conn.getContentType() )){
    return true;

Environment

None

Assignee

Unassigned

Reporter

codehaus

Triage

None

Fix versions

Affects versions

Priority

High
Configure