Patch for Enhancement Bug # 6313849 and 417591

Christopher Hegarty - Sun Microsystems Ireland Christopher.Hegarty at Sun.COM
Thu May 17 03:46:56 PDT 2007


Alan Bateman wrote:
> One final thing to think about is if we want a default implementation 
> rather than adding an abstract method.

I agree with Alan here. Adding disconnect as an abstract method will 
break both binary and source compatibility.

 From a binary point of view URLConnection subclasses compiled and 
runnable with Java SE 6 (or lower) will now throw a 
java.lang.AbstractMethodError if the disconnect method is called.

 From a source perspective URLConnection subclasses that previously 
compiled with Java SE 6 will no longer compile with the java compiler 
(javac) from Java SE 7 : ...Class is not abstract and does not override 
abstract method disconnect() in ...

For these reasons I would suggest that having a default implementation 
would be better.

-Chris.



More information about the net-dev mailing list