Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-28 Thread Peter Levart
On 04/28/2016 09:06 PM, Jason Mehrens wrote: Hi Peter, As mentioned, Class.newInstance() has a special cache for constructor and caller that speeds up repeated invocations from the same caller by skipping access checks. I'm sure I'm missing something obvious related to performance or securit

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-28 Thread Jason Mehrens
Hi Peter, >As mentioned, Class.newInstance() has a special cache for constructor >and caller that speeds up repeated invocations from the same caller by >skipping access checks. I'm sure I'm missing something obvious related to performance or security but, couldn't the exact same 'cachedConstru

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-27 Thread Peter Levart
Hi Joe, On 04/22/2016 07:47 PM, joe darcy wrote: Hi Roger, Per other discussion in the thread, no new method will be introduced. The area owners will need to cleanup this usage of this method since it may involve restructuring of catch blocks, etc., since the recommended approach has differ

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-27 Thread joe darcy
Hi Daniel, Good catch! I've fixed that in my working copy of the changes. Thanks for the careful review, -Joe On 4/27/2016 7:20 AM, Daniel Fuchs wrote: Hi Joe, Changes in java.util.logging and java.management look good. I glanced at the rest and spotted one issue here: http://cr.openjdk.ja

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-27 Thread Daniel Fuchs
Hi Joe, Changes in java.util.logging and java.management look good. I glanced at the rest and spotted one issue here: http://cr.openjdk.java.net/~darcy/6850612.0/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java.frames.html 615 Object o = Class.forName("

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-26 Thread Sean Mullan
The changes to the security-libs portions look fine to me. --Sean On 04/21/2016 12:25 PM, joe darcy wrote: Hello, After a generally positive reception, please review the webrev to implement the deprecation of Class.newInstance and the suppression of the resulting warnings: http://cr.open

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-22 Thread joe darcy
Hi Roger, Per other discussion in the thread, no new method will be introduced. The area owners will need to cleanup this usage of this method since it may involve restructuring of catch blocks, etc., since the recommended approach has different exception behavior. Thanks, -Joe On 4/22/201

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-22 Thread Roger Riggs
Hi Joe, Wouldn't it be less make work to introduce the new method, replace the current one where appropriate and then deprecate the existing method? As it is, you/someone is going to make a second pass over all the same files. Roger On 4/21/2016 12:25 PM, joe darcy wrote: Hello, After a

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-21 Thread joe darcy
Hello, After a generally positive reception, please review the webrev to implement the deprecation of Class.newInstance and the suppression of the resulting warnings: http://cr.openjdk.java.net/~darcy/6850612.0/ There are also some changes in the langtools repo; I'll send a separate rev

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-19 Thread Rémi Forax
I wanted to reply that if you have a perf sensitive code that uses newInstance you should use a MethodHandle instead to avoid to do the security checks multiple times but i remember that they was an issue with MethodHandle attached to a constructor and i don't know if it was resolved. Rémi Le

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-19 Thread Peter Levart
Hi, On 04/19/2016 01:05 AM, Stuart Marks wrote: On 4/17/16 10:31 AM, joe darcy wrote: With talk of deprecation in the air [1], I thought it would be a fine time to "In the Spring a young man's fancy lightly turns to thoughts of deprecation." -- apologies to Tennyson examine one of t

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-18 Thread Joseph D. Darcy
Hello, With that feedback, I'll go ahead and prepare a changeset for the deprecation of this method and the suppression of the resulting warnings. Thanks, -Joe On 4/18/2016 5:26 PM, David Holmes wrote: I agree with Stuart. David On 19/04/2016 9:05 AM, Stuart Marks wrote: On 4/17/16 10:

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-18 Thread David Holmes
I agree with Stuart. David On 19/04/2016 9:05 AM, Stuart Marks wrote: On 4/17/16 10:31 AM, joe darcy wrote: With talk of deprecation in the air [1], I thought it would be a fine time to "In the Spring a young man's fancy lightly turns to thoughts of deprecation." -- apologies to Tenny

Re: JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-18 Thread Stuart Marks
On 4/17/16 10:31 AM, joe darcy wrote: With talk of deprecation in the air [1], I thought it would be a fine time to "In the Spring a young man's fancy lightly turns to thoughts of deprecation." -- apologies to Tennyson examine one of the bugs on my list JDK-6850612: Deprecate Clas

JDK 9 pre-review of JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract

2016-04-17 Thread joe darcy
Hello, With talk of deprecation in the air [1], I thought it would be a fine time to examine one of the bugs on my list JDK-6850612: Deprecate Class.newInstance since it violates the checked exception language contract As the title of the bug implies, The Class.newInstance method knowin