サンプル

public static class ClassA {
private URL url = new URL("http://example.com");
private URL url2;
public void methodA {
try {
if(url.equals(url2)){
//...
} } catch ( Exception e ) {
//...
}
}

}
解決策
URL オブジェクトの代わりに URI オブジェクトを使用してください。

public static class ClassA {
private URI uri = new URI("http://example.com");
private URI uri2;
public void methodA {
try {
if(uri.equals(uri2)){
//...
} } catch ( Exception e ) {
//...
}
}

}