From Sergey.Bylokhov at oracle.com Tue Feb 9 15:45:44 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 9 Feb 2016 18:45:44 +0300 Subject: [9] Review Request: 8136382 SimpleBeanInfo.loadImage succeeds when running with a security manager Message-ID: <56BA09A8.7030304@oracle.com> Hello. Please review the fix for jdk9. This fix revert back the fix for JDK-8131926: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/58fde919b6c3 http://mail.openjdk.java.net/pipermail/beans-dev/2015-August/000178.html In the fix of JDK-8131926 we replaced getResource to getResourceAsStream, because "resources are private to a named module and as things stand, there isn't a way to a URL to a resource in a named module." But in current implementation "Class::getResource" will returns a URL to a resource in a module, when invoked from code within that module (0fbe4c72638a). And it also apply security checks. Bug: https://bugs.openjdk.java.net/browse/JDK-8136382 Webrev can be found at: http://cr.openjdk.java.net/~serb/8136382/webrev.00 -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Tue Feb 9 17:17:27 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 9 Feb 2016 20:17:27 +0300 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created Message-ID: <56BA1F27.4090002@oracle.com> Hello. Please review the fix for jdk9. The specification is updated, the test will use IllegalArgumentException instead of IllegalAccessError. ccc will be filed after the technical review. Bug: https://bugs.openjdk.java.net/browse/JDK-8130061 Webrev can be found at: http://cr.openjdk.java.net/~serb/8130061/webrev.00 -- Best regards, Sergey. From Alan.Bateman at oracle.com Tue Feb 9 20:40:29 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 9 Feb 2016 21:40:29 +0100 Subject: [9] Review Request: 8136382 SimpleBeanInfo.loadImage succeeds when running with a security manager In-Reply-To: <56BA09A8.7030304@oracle.com> References: <56BA09A8.7030304@oracle.com> Message-ID: <56BA4EBD.3010809@oracle.com> On 09/02/2016 16:45, Sergey Bylokhov wrote: > Hello. > > Please review the fix for jdk9. > This fix revert back the fix for JDK-8131926: > http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/58fde919b6c3 > http://mail.openjdk.java.net/pipermail/beans-dev/2015-August/000178.html > > In the fix of JDK-8131926 we replaced getResource to > getResourceAsStream, because "resources are private to a named module > and as things stand, there isn't a way to a URL to a resource in a > named module." But in current implementation "Class::getResource" will > returns a URL to a resource in a module, when invoked from code within > that module (0fbe4c72638a). And it also apply security checks. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8136382 > Webrev can be found at: > http://cr.openjdk.java.net/~serb/8136382/webrev.00 > Sergey - have you consider clarifying the javadoc as part of this change? -Alan From Sergey.Bylokhov at oracle.com Tue Feb 9 20:49:36 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Tue, 9 Feb 2016 23:49:36 +0300 Subject: [9] Review Request: 8136382 SimpleBeanInfo.loadImage succeeds when running with a security manager In-Reply-To: <56BA4EBD.3010809@oracle.com> References: <56BA09A8.7030304@oracle.com> <56BA4EBD.3010809@oracle.com> Message-ID: <56BA50E0.30101@oracle.com> On 09.02.16 23:40, Alan Bateman wrote: > Sergey - have you consider clarifying the javadoc as part of this change? I can add clarification that this is a shortcut to the getResourceAsStream/getResource which simplify loading of images, but the current implementations of getResourceAsStream/getResource change from time to time, so I am not sure that I can describe some stable behavior. -- Best regards, Sergey. From Alan.Bateman at oracle.com Thu Feb 11 15:22:23 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 11 Feb 2016 15:22:23 +0000 Subject: [9] Review Request: 8136382 SimpleBeanInfo.loadImage succeeds when running with a security manager In-Reply-To: <56BA50E0.30101@oracle.com> References: <56BA09A8.7030304@oracle.com> <56BA4EBD.3010809@oracle.com> <56BA50E0.30101@oracle.com> Message-ID: <56BCA72F.80401@oracle.com> On 09/02/2016 20:49, Sergey Bylokhov wrote: > On 09.02.16 23:40, Alan Bateman wrote: >> Sergey - have you consider clarifying the javadoc as part of this >> change? > > I can add clarification that this is a shortcut to the > getResourceAsStream/getResource which simplify loading of images, but > the current implementations of getResourceAsStream/getResource change > from time to time, so I am not sure that I can describe some stable > behavior. > With the updated implementation then you are isolated from possible changes. You are right that there may be changes on resource encapsulation and okay with me if you put all changing the spec until then. One thing that could be done, separate issue if you want, is update the @return to say that it returns null if the resource is not found or the resource could not be loaded as an Image. That might be clearer than the existing wording. -Alan. From Alan.Bateman at oracle.com Thu Feb 11 15:26:20 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 11 Feb 2016 15:26:20 +0000 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BA1F27.4090002@oracle.com> References: <56BA1F27.4090002@oracle.com> Message-ID: <56BCA81C.4010502@oracle.com> On 09/02/2016 17:17, Sergey Bylokhov wrote: > Hello. > Please review the fix for jdk9. > > The specification is updated, the test will use > IllegalArgumentException instead of IllegalAccessError. > ccc will be filed after the technical review. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8130061 > Webrev can be found at: > http://cr.openjdk.java.net/~serb/8130061/webrev.00 > Should this say newProxyInstance rather than getProxyClass? -Alan. From Sergey.Bylokhov at oracle.com Thu Feb 11 15:49:55 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 11 Feb 2016 18:49:55 +0300 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BCA81C.4010502@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> Message-ID: <56BCADA3.20600@oracle.com> On 11.02.16 18:26, Alan Bateman wrote: > On 09/02/2016 17:17, Sergey Bylokhov wrote: >> Hello. >> Please review the fix for jdk9. >> >> The specification is updated, the test will use >> IllegalArgumentException instead of IllegalAccessError. >> ccc will be filed after the technical review. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8130061 >> Webrev can be found at: >> http://cr.openjdk.java.net/~serb/8130061/webrev.00 >> > Should this say newProxyInstance rather than getProxyClass? The Proxy.newProxyInstance() has not the description of why the IllegalArgumentException can be thrown, it points to Proxy.getProxyClass(): *

{@code Proxy.newProxyInstance} throws * {@code IllegalArgumentException} for the same reasons that * {@code Proxy.getProxyClass} does. ...... * @throws IllegalArgumentException if any of the restrictions on the * parameters that may be passed to {@code getProxyClass} * are violated public static Object newProxyInstance(ClassLoader loader, Class[] interfaces, InvocationHandler h) -- Best regards, Sergey. From Alan.Bateman at oracle.com Thu Feb 11 15:52:41 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 11 Feb 2016 15:52:41 +0000 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BCADA3.20600@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> <56BCADA3.20600@oracle.com> Message-ID: <56BCAE49.8070808@oracle.com> On 11/02/2016 15:49, Sergey Bylokhov wrote: > > The Proxy.newProxyInstance() has not the description of why the > IllegalArgumentException can be thrown, it points to > Proxy.getProxyClass(): > > *

{@code Proxy.newProxyInstance} throws > * {@code IllegalArgumentException} for the same reasons that > * {@code Proxy.getProxyClass} does. > ...... > * @throws IllegalArgumentException if any of the restrictions on > the > * parameters that may be passed to {@code getProxyClass} > * are violated > public static Object newProxyInstance(ClassLoader loader, > Class[] interfaces, > InvocationHandler h) > > Proxy.getProxyClass is proposed to be deprecated in Java SE 9 - you'll see the changes in the jake forest, they just haven't got to JDK 9 main line yet. There is also a very clear list of restrictions in the updated javadoc. Since you are going into jdk9/client then maybe the simplest is to just reference the restrictions in the Proxy class. -Alan From Sergey.Bylokhov at oracle.com Thu Feb 11 15:58:44 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 11 Feb 2016 18:58:44 +0300 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BCAE49.8070808@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> <56BCADA3.20600@oracle.com> <56BCAE49.8070808@oracle.com> Message-ID: <56BCAFB4.4000903@oracle.com> On 11.02.16 18:52, Alan Bateman wrote: > Proxy.getProxyClass is proposed to be deprecated in Java SE 9 - you'll > see the changes in the jake forest, they just haven't got to JDK 9 main > line yet. There is also a very clear list of restrictions in the updated > javadoc. Since you are going into jdk9/client then maybe the simplest is > to just reference the restrictions in the Proxy class. Right, the new javadoc of newProxyInstance() in the jake is quite detailed, I'll update the fix. -- Best regards, Sergey. From mandy.chung at oracle.com Thu Feb 11 19:53:02 2016 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 11 Feb 2016 11:53:02 -0800 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BCAFB4.4000903@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> <56BCADA3.20600@oracle.com> <56BCAE49.8070808@oracle.com> <56BCAFB4.4000903@oracle.com> Message-ID: > On Feb 11, 2016, at 7:58 AM, Sergey Bylokhov wrote: > > On 11.02.16 18:52, Alan Bateman wrote: >> Proxy.getProxyClass is proposed to be deprecated in Java SE 9 - you'll >> see the changes in the jake forest, they just haven't got to JDK 9 main >> line yet. There is also a very clear list of restrictions in the updated >> javadoc. Since you are going into jdk9/client then maybe the simplest is >> to just reference the restrictions in the Proxy class. > > Right, the new javadoc of newProxyInstance() in the jake is quite detailed, I'll update the fix. In case, anyone is interested in the jake?s updated spec of newProxyInstance: http://download.java.net/jigsaw/docs/api/java/lang/reflect/Proxy.html#newProxyInstance-java.lang.ClassLoader-java.lang.Class:A-java.lang.reflect.InvocationHandler- Mandy From Sergey.Bylokhov at oracle.com Thu Feb 11 21:00:03 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 12 Feb 2016 00:00:03 +0300 Subject: [9] Review Request: 8136382 SimpleBeanInfo.loadImage succeeds when running with a security manager In-Reply-To: <56BCA72F.80401@oracle.com> References: <56BA09A8.7030304@oracle.com> <56BA4EBD.3010809@oracle.com> <56BA50E0.30101@oracle.com> <56BCA72F.80401@oracle.com> Message-ID: <56BCF653.4040204@oracle.com> On 11.02.16 18:22, Alan Bateman wrote: > > One thing that could be done, separate issue if you want, is update the > @return to say that it returns null if the resource is not found or the > resource could not be loaded as an Image. That might be clearer than the > existing wording. Something like this? http://cr.openjdk.java.net/~serb/8136382/webrev.01 -- Best regards, Sergey. From Sergey.Bylokhov at oracle.com Thu Feb 11 21:19:03 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 12 Feb 2016 00:19:03 +0300 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BCAFB4.4000903@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> <56BCADA3.20600@oracle.com> <56BCAE49.8070808@oracle.com> <56BCAFB4.4000903@oracle.com> Message-ID: <56BCFAC7.7080906@oracle.com> On 11.02.16 18:58, Sergey Bylokhov wrote: > On 11.02.16 18:52, Alan Bateman wrote: >> Proxy.getProxyClass is proposed to be deprecated in Java SE 9 - you'll >> see the changes in the jake forest, they just haven't got to JDK 9 main >> line yet. There is also a very clear list of restrictions in the updated >> javadoc. Since you are going into jdk9/client then maybe the simplest is >> to just reference the restrictions in the Proxy class. > > Right, the new javadoc of newProxyInstance() in the jake is quite > detailed, I'll update the fix. The new version: http://cr.openjdk.java.net/~serb/8130061/webrev.01 -- Best regards, Sergey. From Alan.Bateman at oracle.com Fri Feb 12 08:47:38 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 12 Feb 2016 08:47:38 +0000 Subject: [9] Review Request: 8136382 SimpleBeanInfo.loadImage succeeds when running with a security manager In-Reply-To: <56BCF653.4040204@oracle.com> References: <56BA09A8.7030304@oracle.com> <56BA4EBD.3010809@oracle.com> <56BA50E0.30101@oracle.com> <56BCA72F.80401@oracle.com> <56BCF653.4040204@oracle.com> Message-ID: <56BD9C2A.9050006@oracle.com> On 11/02/2016 21:00, Sergey Bylokhov wrote: > > Something like this? > http://cr.openjdk.java.net/~serb/8136382/webrev.01 > @return looks good. -Alan From Alan.Bateman at oracle.com Fri Feb 12 09:08:06 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 12 Feb 2016 09:08:06 +0000 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BCFAC7.7080906@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> <56BCADA3.20600@oracle.com> <56BCAE49.8070808@oracle.com> <56BCAFB4.4000903@oracle.com> <56BCFAC7.7080906@oracle.com> Message-ID: <56BDA0F6.3070703@oracle.com> On 11/02/2016 21:19, Sergey Bylokhov wrote: > > The new version: > http://cr.openjdk.java.net/~serb/8130061/webrev.01 > This is okay although the following might be a bit clearer (up to you): "if creating a Proxy for {@code listenerInterface} fails for any of the restrictions specified by Proxy#newProxyInterface". -Alan From Sergey.Bylokhov at oracle.com Fri Feb 12 11:08:14 2016 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Fri, 12 Feb 2016 14:08:14 +0300 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BDA0F6.3070703@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> <56BCADA3.20600@oracle.com> <56BCAE49.8070808@oracle.com> <56BCAFB4.4000903@oracle.com> <56BCFAC7.7080906@oracle.com> <56BDA0F6.3070703@oracle.com> Message-ID: <56BDBD1E.2000402@oracle.com> On 12.02.16 12:08, Alan Bateman wrote: > This is okay although the following might be a bit clearer (up to you): > > "if creating a Proxy for {@code listenerInterface} fails for any of the > restrictions specified by Proxy#newProxyInterface". I agree, it looks better: http://cr.openjdk.java.net/~serb/8130061/webrev.02 -- Best regards, Sergey. From Alan.Bateman at oracle.com Fri Feb 12 11:24:04 2016 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 12 Feb 2016 11:24:04 +0000 Subject: [9] Review Request: 8130061 java.beans.EventHandler.create does not specify how it fails when an EventHandler cannot be created In-Reply-To: <56BDBD1E.2000402@oracle.com> References: <56BA1F27.4090002@oracle.com> <56BCA81C.4010502@oracle.com> <56BCADA3.20600@oracle.com> <56BCAE49.8070808@oracle.com> <56BCAFB4.4000903@oracle.com> <56BCFAC7.7080906@oracle.com> <56BDA0F6.3070703@oracle.com> <56BDBD1E.2000402@oracle.com> Message-ID: <56BDC0D4.3090303@oracle.com> On 12/02/2016 11:08, Sergey Bylokhov wrote: > On 12.02.16 12:08, Alan Bateman wrote: >> This is okay although the following might be a bit clearer (up to you): >> >> "if creating a Proxy for {@code listenerInterface} fails for any of the >> restrictions specified by Proxy#newProxyInterface". > > I agree, it looks better: > http://cr.openjdk.java.net/~serb/8130061/webrev.02 > Looks good to me, thank you for taking the suggestions. -Alan