Re: Review Request: JDK-8206240: java.lang.Class.newInstance() is causing caller to leak

2018-10-04 Thread Peter Levart
Hi Mandy, On 10/04/2018 07:45 PM, Alan Bateman wrote: On 03/10/2018 18:28, Mandy Chung wrote: : On 10/3/18 9:30 AM, Peter Levart wrote: Hi Mandy, I don't know if this matters though, but should Reflection.getCallerClass() ever return null, previous behavior was to throw NPE (from Reflect

Re: Review Request: JDK-8206240: java.lang.Class.newInstance() is causing caller to leak

2018-10-04 Thread Alan Bateman
On 03/10/2018 18:28, Mandy Chung wrote: : On 10/3/18 9:30 AM, Peter Levart wrote: Hi Mandy, I don't know if this matters though, but should Reflection.getCallerClass() ever return null, previous behavior was to throw NPE (from Reflection.verifyMemberAccess(...)), now the checks are skipp

Re: Review Request: JDK-8206240: java.lang.Class.newInstance() is causing caller to leak

2018-10-03 Thread Mandy Chung
On 10/3/18 9:30 AM, Peter Levart wrote: Hi Mandy, I don't know if this matters though, but should Reflection.getCallerClass() ever return null, previous behavior was to throw NPE (from Reflection.verifyMemberAccess(...)), now the checks are skipped. This should only be observable if [Class

Re: Review Request: JDK-8206240: java.lang.Class.newInstance() is causing caller to leak

2018-10-03 Thread Peter Levart
Hi Mandy, I don't know if this matters though, but should Reflection.getCallerClass() ever return null, previous behavior was to throw NPE (from Reflection.verifyMemberAccess(...)), now the checks are skipped. This should only be observable if [Class, Constructor].newInstance() was called fro

Re: Review Request: JDK-8206240: java.lang.Class.newInstance() is causing caller to leak

2018-10-03 Thread Mandy Chung
On 10/3/18 6:02 AM, Alan Bateman wrote: On 02/10/2018 20:33, Mandy Chung wrote: Class::newInstance maintains its separate cache of the caller class after access check.  This leak has been there for a long time and unnoticed. This patch changes Class::newInstance to use the code path for Co

Re: Review Request: JDK-8206240: java.lang.Class.newInstance() is causing caller to leak

2018-10-03 Thread Alan Bateman
On 02/10/2018 20:33, Mandy Chung wrote: Class::newInstance maintains its separate cache of the caller class after access check.  This leak has been there for a long time and unnoticed. This patch changes Class::newInstance to use the code path for Constructor::newInstance doing the access che

Review Request: JDK-8206240: java.lang.Class.newInstance() is causing caller to leak

2018-10-02 Thread Mandy Chung
Class::newInstance maintains its separate cache of the caller class after access check.  This leak has been there for a long time and unnoticed. This patch changes Class::newInstance to use the code path for Constructor::newInstance doing the access check and caching the caller class.  It will al