Re: RFR JDK-4880778
On 02/02/2013 16:29, Alan Bateman wrote: On 02/02/2013 14:39, John Zavgren wrote: Greetings: Please consider the following modification of our classes for handling URLs. http://cr.openjdk.java.net/~jzavgren/4880778/webrev.01/ This looks okay to me. Yes, looks ok to me too. For the URLStreamHandler setURL methods then an alternative to removing the statement would be just adjust the wording, say replace "be able to call the set method on a URL" to "be able to use this method to set the values of the URL fields". I think Alan's wording is probably best here. There a subtlety I missed the first time I read the proposed wording, 'this method'. Overriding setURL in a concrete URLStreamHandler will never be able to set the fields of a URL. So the wording is technically correct. Minor nit, but there are couple of alignment issues. In URL then the arguments spill onto 2 or 3 lines so they can be re-aligned. In URLStreamHandler it look slike the setURL method isn't quite lined up with the other methods (pre-dates your proposed changes). Agreed. -Chris. -Alan.
Re: RFR JDK-4880778
I posted a new webrev image: http://cr.openjdk.java.net/~jzavgren/4880778/webrev.02/ I made two changes: 1.) modified the indentation that's used for the argument list of the URL class set() methods. 2.) changed the documentation for the set method in the URLStreamHandler class. - Original Message - From: john.zavg...@oracle.com To: net-dev@openjdk.java.net Sent: Saturday, February 2, 2013 9:47:31 AM GMT -05:00 US/Canada Eastern Subject: RFR JDK-4880778 Greetings: Please consider the following modification of our classes for handling URLs. http://cr.openjdk.java.net/~jzavgren/4880778/webrev.01/ background See http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html. The URL class is declared final yet has two protected methods: protected void set(String protocol, String host, int port, String file, String ref) protected void set(String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) Since the final class can't be subclassed these methods can't be accessed. They could be package protected instead. (i.e. no access specifier) Solution: 1.) I made the set method in the URL class "package protected" 2.) I edited the java doc documentation to eliminate reference to the set method in the URL class from the URLStreamHandler class 3.) I wrote a test program (URLTest.java) (at the end of this message) that attempts to call the set method from a URL object... When there is no package statement: //package java.net; the compilation fails java/net/URLTest.java:28: error: set(String,String,int,String,String,String,String,String) is not public in URL; cannot be accessed from outside package myURL.set("ftp", "vpn.zavgren.com", 77, "lugnut.txt", "","","",""); ^ 1 error 4.) When there is a package statement in the source code: package java.net; the code compiles but it creates a run time error. jzavgren@ubuntuVM:~/code/java/URL$ java java.net.URLTest Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.net at java.lang.ClassLoader.preDefineClass(ClassLoader.java:651) at java.lang.ClassLoader.defineClass(ClassLoader.java:785) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:442) at java.net.URLClassLoader.access$100(URLClassLoader.java:64) at java.net.URLClassLoader$1.run(URLClassLoader.java:354) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:491) - URLTest.java - package java.net; import java.net.*; import java.io.*; public class URLTest { public static void main (String[]args) { URL myURL=null; try { myURL = new URL ("http", "www.zavgren.com", 80, "/index.html"); } catch (MalformedURLException mfue) { System.err.println (mfue); } System.out.printf ("The URL is: %s\n", myURL.toString ()); System.out.printf ("The protocol is: %s\n", myURL.getProtocol()); System.out.printf ("The external form is: %s\n", myURL.toExternalForm()); System.out.printf ("Opening connection... \n"); try { URLConnection uc = myURL.openConnection(); } catch (IOException io) { } myURL.set("ftp", "vpn.zavgren.com", 77, "lugnut.txt", "","","",""); } }; Thanks! John
Re: RFR JDK-4880778
Thanks John, Trivially, and unrelated to your changes but while you're there, I would really like to remove "are supposed to". < * Only classes derived from URLStreamHandler are supposed to be able < * to use this method to set the values of the URL fields. --- > * Only classes derived from URLStreamHandler are able to use this > * method to set the values of the URL fields. It is still not great, but I think the best we can do with an old API. -Chris. On 04/02/2013 14:00, John Zavgren wrote: I posted a new webrev image: http://cr.openjdk.java.net/~jzavgren/4880778/webrev.02/ I made two changes: 1.) modified the indentation that's used for the argument list of the URL class set() methods. 2.) changed the documentation for the set method in the URLStreamHandler class. - Original Message - From: john.zavg...@oracle.com To: net-dev@openjdk.java.net Sent: Saturday, February 2, 2013 9:47:31 AM GMT -05:00 US/Canada Eastern Subject: RFR JDK-4880778 Greetings: Please consider the following modification of our classes for handling URLs. http://cr.openjdk.java.net/~jzavgren/4880778/webrev.01/ background See http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html. The URL class is declared final yet has two protected methods: protected void set(String protocol, String host, int port, String file, String ref) protected void set(String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) Since the final class can't be subclassed these methods can't be accessed. They could be package protected instead. (i.e. no access specifier) Solution: 1.) I made the set method in the URL class "package protected" 2.) I edited the java doc documentation to eliminate reference to the set method in the URL class from the URLStreamHandler class 3.) I wrote a test program (URLTest.java) (at the end of this message) that attempts to call the set method from a URL object... When there is no package statement: //package java.net; the compilation fails java/net/URLTest.java:28: error: set(String,String,int,String,String,String,String,String) is not public in URL; cannot be accessed from outside package myURL.set("ftp", "vpn.zavgren.com", 77, "lugnut.txt", "","","",""); ^ 1 error 4.) When there is a package statement in the source code: package java.net; the code compiles but it creates a run time error. jzavgren@ubuntuVM:~/code/java/URL$ java java.net.URLTest Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.net at java.lang.ClassLoader.preDefineClass(ClassLoader.java:651) at java.lang.ClassLoader.defineClass(ClassLoader.java:785) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:442) at java.net.URLClassLoader.access$100(URLClassLoader.java:64) at java.net.URLClassLoader$1.run(URLClassLoader.java:354) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:491) - URLTest.java - package java.net; import java.net.*; import java.io.*; public class URLTest { public static void main (String[]args) { URL myURL=null; try { myURL = new URL ("http", "www.zavgren.com", 80, "/index.html"); } catch (MalformedURLException mfue) { System.err.println (mfue); } System.out.printf ("The URL is: %s\n", myURL.toString ()); System.out.printf ("The protocol is: %s\n", myURL.getProtocol()); System.out.printf ("The external form is: %s\n", myURL.toExternalForm()); System.out.printf ("Opening connection... \n"); try { URLConnection uc = myURL.openConnection(); } catch (IOException io) { } myURL.set("ftp", "vpn.zavgren.com", 77, "lugnut.txt", "","","",""); } }; Thanks! John
hg: jdk8/tl/jdk: 8006994: Cleanup PKCS12 tests to ensure streams get closed
Changeset: 5bf1c9e6be60 Author:vinnie Date: 2013-02-04 17:20 + URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5bf1c9e6be60 8006994: Cleanup PKCS12 tests to ensure streams get closed Reviewed-by: mullan ! test/java/security/KeyStore/PBETest.java ! test/sun/security/pkcs12/StorePasswordTest.java ! test/sun/security/pkcs12/StoreSecretKeyTest.java ! test/sun/security/pkcs12/StoreTrustedCertTest.java
Re: RFR JDK-4880778
Chris: I made the documentation change: http://cr.openjdk.java.net/~jzavgren/4880778/webrev.03/ John - Original Message - From: chris.hega...@oracle.com To: john.zavg...@oracle.com Cc: net-dev@openjdk.java.net Sent: Monday, February 4, 2013 11:19:42 AM GMT -05:00 US/Canada Eastern Subject: Re: RFR JDK-4880778 Thanks John, Trivially, and unrelated to your changes but while you're there, I would really like to remove "are supposed to". < * Only classes derived from URLStreamHandler are supposed to be able < * to use this method to set the values of the URL fields. --- > * Only classes derived from URLStreamHandler are able to use this > * method to set the values of the URL fields. It is still not great, but I think the best we can do with an old API. -Chris. On 04/02/2013 14:00, John Zavgren wrote: > I posted a new webrev image: > http://cr.openjdk.java.net/~jzavgren/4880778/webrev.02/ > > I made two changes: > 1.) modified the indentation that's used for the argument list of the URL > class set() methods. > 2.) changed the documentation for the set method in the URLStreamHandler > class. > > > - Original Message - > From: john.zavg...@oracle.com > To: net-dev@openjdk.java.net > Sent: Saturday, February 2, 2013 9:47:31 AM GMT -05:00 US/Canada Eastern > Subject: RFR JDK-4880778 > > Greetings: > > Please consider the following modification of our classes for handling URLs. > > http://cr.openjdk.java.net/~jzavgren/4880778/webrev.01/ > > background > See http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html. > The URL class is declared final yet has two protected methods: > > protected void set(String protocol, > String host, > int port, > String file, > String ref) > > protected void set(String protocol, > String host, > int port, > String authority, > String userInfo, > String path, > String query, > String ref) > > > Since the final class can't be subclassed these methods can't be accessed. > They could be package protected instead. (i.e. no access specifier) > > Solution: > 1.) I made the set method in the URL class "package protected" > 2.) I edited the java doc documentation to eliminate reference to the set > method in the URL class from the URLStreamHandler class > > 3.) I wrote a test program (URLTest.java) (at the end of this message) that > attempts to call the set method from a URL object... > When there is no package statement: > > //package java.net; > > the compilation fails > java/net/URLTest.java:28: error: > set(String,String,int,String,String,String,String,String) is not public in > URL; cannot be accessed from outside package > myURL.set("ftp", "vpn.zavgren.com", 77, "lugnut.txt", "","","",""); > ^ > 1 error > 4.) When there is a package statement in the source code: > > package java.net; > > the code compiles but it creates a run time error. > jzavgren@ubuntuVM:~/code/java/URL$ java java.net.URLTest > Exception in thread "main" java.lang.SecurityException: Prohibited package > name: java.net > at java.lang.ClassLoader.preDefineClass(ClassLoader.java:651) > at java.lang.ClassLoader.defineClass(ClassLoader.java:785) > at > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) > at java.net.URLClassLoader.defineClass(URLClassLoader.java:442) > at java.net.URLClassLoader.access$100(URLClassLoader.java:64) > at java.net.URLClassLoader$1.run(URLClassLoader.java:354) > at java.net.URLClassLoader$1.run(URLClassLoader.java:348) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:347) > at java.lang.ClassLoader.loadClass(ClassLoader.java:423) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) > at java.lang.ClassLoader.loadClass(ClassLoader.java:356) > at > sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:491) > - URLTest.java - > package java.net; > import java.net.*; > import java.io.*; > public class URLTest > { >public static void main (String[]args) >{ > URL myURL=null; >try > { >myURL = new URL ("http", "www.zavgren.com", 80, "/index.html"); > } > catch (MalformedURLException mfue) > { >System.err.println (mfue); > } > System.out.printf ("The URL is: %s\n", myURL.toString ()); > System.out.printf ("The protocol is: %s\n", myURL.getProtocol()); > System.out.printf ("The external form is: %s\n", myURL.toExternalForm()); > System.out.printf ("Opening connection... \n"); > try > { > URLConnection uc = myURL.openConnection(); > } > catch (IOException io)
Re: RFR JDK-4880778
Thank you John, looks good to me. -Chris. On 02/04/2013 05:24 PM, John Zavgren wrote: Chris: I made the documentation change: http://cr.openjdk.java.net/~jzavgren/4880778/webrev.03/ John - Original Message - From: chris.hega...@oracle.com To: john.zavg...@oracle.com Cc: net-dev@openjdk.java.net Sent: Monday, February 4, 2013 11:19:42 AM GMT -05:00 US/Canada Eastern Subject: Re: RFR JDK-4880778 Thanks John, Trivially, and unrelated to your changes but while you're there, I would really like to remove "are supposed to". < * Only classes derived from URLStreamHandler are supposed to be able < * to use this method to set the values of the URL fields. --- > * Only classes derived from URLStreamHandler are able to use this > * method to set the values of the URL fields. It is still not great, but I think the best we can do with an old API. -Chris. On 04/02/2013 14:00, John Zavgren wrote: I posted a new webrev image: http://cr.openjdk.java.net/~jzavgren/4880778/webrev.02/ I made two changes: 1.) modified the indentation that's used for the argument list of the URL class set() methods. 2.) changed the documentation for the set method in the URLStreamHandler class. - Original Message - From: john.zavg...@oracle.com To: net-dev@openjdk.java.net Sent: Saturday, February 2, 2013 9:47:31 AM GMT -05:00 US/Canada Eastern Subject: RFR JDK-4880778 Greetings: Please consider the following modification of our classes for handling URLs. http://cr.openjdk.java.net/~jzavgren/4880778/webrev.01/ background See http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html. The URL class is declared final yet has two protected methods: protected void set(String protocol, String host, int port, String file, String ref) protected void set(String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) Since the final class can't be subclassed these methods can't be accessed. They could be package protected instead. (i.e. no access specifier) Solution: 1.) I made the set method in the URL class "package protected" 2.) I edited the java doc documentation to eliminate reference to the set method in the URL class from the URLStreamHandler class 3.) I wrote a test program (URLTest.java) (at the end of this message) that attempts to call the set method from a URL object... When there is no package statement: //package java.net; the compilation fails java/net/URLTest.java:28: error: set(String,String,int,String,String,String,String,String) is not public in URL; cannot be accessed from outside package myURL.set("ftp", "vpn.zavgren.com", 77, "lugnut.txt", "","","",""); ^ 1 error 4.) When there is a package statement in the source code: package java.net; the code compiles but it creates a run time error. jzavgren@ubuntuVM:~/code/java/URL$ java java.net.URLTest Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.net at java.lang.ClassLoader.preDefineClass(ClassLoader.java:651) at java.lang.ClassLoader.defineClass(ClassLoader.java:785) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:442) at java.net.URLClassLoader.access$100(URLClassLoader.java:64) at java.net.URLClassLoader$1.run(URLClassLoader.java:354) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:491) - URLTest.java - package java.net; import java.net.*; import java.io.*; public class URLTest { public static void main (String[]args) { URL myURL=null; try { myURL = new URL ("http", "www.zavgren.com", 80, "/index.html"); } catch (MalformedURLException mfue) { System.err.println (mfue); } System.out.printf ("The URL is: %s\n", myURL.toString ()); System.out.printf ("The protocol is: %s\n", myURL.getProtocol()); System.out.printf ("The external form is: %s\n", myURL.toExternalForm()); System.out.printf ("Opening connection... \n"); try { URLConnection uc = myURL.openConnection(); } catch (IOException io) { } myURL.set("ftp", "vpn.zavgren.com", 77, "lugnut.
hg: jdk8/tl/jdk: 8006295: Base64.Decoder.wrap(java.io.InputStream) returns InputStream which throws unspecified IOException on attempt to decode invalid Base64 byte stream; ...
Changeset: e202f43a8b8a Author:sherman Date: 2013-02-04 11:58 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e202f43a8b8a 8006295: Base64.Decoder.wrap(java.io.InputStream) returns InputStream which throws unspecified IOException on attempt to decode invalid Base64 byte stream 8006315: Base64.Decoder decoding methods are not consistent in treating non-padded data 8006530: Base64.getMimeDecoder().decode() throws exception for non-base64 character after adding = Summary: updated the spec to describe the expected behave explicitly and the implementation to follow Reviewed-by: alanb, chegar, lancea ! src/share/classes/java/util/Base64.java ! test/java/util/Base64/TestBase64.java
hg: jdk8/tl/langtools: 8007490: NPE from DocumentationTool.run
Changeset: 1690928dc560 Author:jjg Date: 2013-02-04 15:30 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/1690928dc560 8007490: NPE from DocumentationTool.run Reviewed-by: darcy ! src/share/classes/com/sun/tools/javadoc/api/JavadocTool.java ! test/tools/javadoc/api/basic/RunTest.java
hg: jdk8/tl/jdk: 8007113: Upgrade AnnotatedElement.isAnnotionPresent to be a default method
Changeset: e04467fa13af Author:darcy Date: 2013-02-04 17:56 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e04467fa13af 8007113: Upgrade AnnotatedElement.isAnnotionPresent to be a default method Reviewed-by: chegar, jfranck ! src/share/classes/java/lang/Class.java ! src/share/classes/java/lang/Package.java ! src/share/classes/java/lang/reflect/AccessibleObject.java ! src/share/classes/java/lang/reflect/AnnotatedElement.java ! src/share/classes/java/lang/reflect/Parameter.java ! src/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java ! src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java
hg: jdk8/tl/langtools: 8007492: DocumentationTool cannot locate standard doclet when invoked from JRE
Changeset: 62d91c13dce2 Author:jjg Date: 2013-02-04 18:14 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/62d91c13dce2 8007492: DocumentationTool cannot locate standard doclet when invoked from JRE Reviewed-by: darcy ! src/share/classes/com/sun/tools/javadoc/api/JavadocTool.java
hg: jdk8/tl: Added tag jdk8-b75 for changeset 2a713921952c
Changeset: 5b19cef637a6 Author:katleman Date: 2013-01-31 17:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/5b19cef637a6 Added tag jdk8-b75 for changeset 2a713921952c ! .hgtags
hg: jdk8/tl/corba: Added tag jdk8-b75 for changeset d4e68ce17795
Changeset: 4a6be02e66a3 Author:katleman Date: 2013-01-31 17:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/4a6be02e66a3 Added tag jdk8-b75 for changeset d4e68ce17795 ! .hgtags
hg: jdk8/tl/jaxp: Added tag jdk8-b75 for changeset ff0b73a6b3f6
Changeset: 8d65b381880b Author:katleman Date: 2013-01-31 17:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/8d65b381880b Added tag jdk8-b75 for changeset ff0b73a6b3f6 ! .hgtags
hg: jdk8/tl/hotspot: Added tag jdk8-b75 for changeset 6778d0b16593
Changeset: 20b605466ccb Author:katleman Date: 2013-01-31 17:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/20b605466ccb Added tag jdk8-b75 for changeset 6778d0b16593 ! .hgtags
hg: jdk8/tl/langtools: 2 new changesets
Changeset: 716935fec613 Author:katleman Date: 2013-01-31 17:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/716935fec613 Added tag jdk8-b75 for changeset c2e11e2ec4a3 ! .hgtags Changeset: 10619513f51a Author:lana Date: 2013-02-04 22:38 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/10619513f51a Merge
hg: jdk8/tl/jdk: 2 new changesets
Changeset: 6ba6353ab42c Author:katleman Date: 2013-01-31 17:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6ba6353ab42c Added tag jdk8-b75 for changeset 4a67fdb752b7 ! .hgtags Changeset: fd37f0846653 Author:lana Date: 2013-02-04 22:37 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fd37f0846653 Merge
hg: jdk8/tl/jaxws: Added tag jdk8-b75 for changeset 966bf9f3c41a
Changeset: a63ef2391c20 Author:katleman Date: 2013-01-31 17:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/a63ef2391c20 Added tag jdk8-b75 for changeset 966bf9f3c41a ! .hgtags