Alan, could you please commit this patch for me? We've tested it locally and all of the jdk_other tests pass with this change on jdk9.
93d92 < * Once installed, the builder cannot be replaced. 101d99 < * @exception IllegalStateException If a factory has already been installed. 109,111d106 < if (object_factory_builder != null) < throw new IllegalStateException("ObjectFactoryBuilder already set"); < 739,740c734 < * the security manager to do so. Once installed, the builder cannot < * be replaced. --- > * the security manager to do so. 747d740 < * @exception IllegalStateException If a builder was previous installed. 754,757d746 < if (initctx_factory_builder != null) < throw new IllegalStateException( < "InitialContextFactoryBuilder already set"); < Alan Bateman <alan.bate...@oracle.com> wrote on 05/10/2017 07:32:47 AM: > From: Alan Bateman <alan.bate...@oracle.com> > To: Andrew Guibert <aguib...@us.ibm.com>, core-libs-dev@openjdk.java.net > Date: 05/10/2017 07:32 AM > Subject: Re: Proposal: > javax.naming.spi.NamingManager.clearInitialContextFactoryBuilder() > > On 08/05/2017 23:27, Andrew Guibert wrote: > > > : > > > > I am not sure why the "no resetting" restriction is on the NamingManager > > API in the first place. Is anyone aware why the API has this restriction? > > In any case, the solution outlined above seems rather messy (as it only > > solves the problem by mitigating a classloader leak), so I would like to > > propose the following addition to the NamingManager API: > > > > > I checked with one of the engineers that worked on the JNDI API a long > time ago and there doesn't seem to be any significant reason to disallow > it be changed. > > Looking at it now then it might be simpler to change > setInitialContextFactoryBuilder to allow a new builder to be set rather > than introducing a clearXXX method. I can't imagine anything but tests > relying on IllegalStateException to be thrown if already set. A variant > to explore is setting the builder to a placeholder InitialContextFactory > rather than null. > > So is your plan to proposal a patch and tests for this? > > -Alan >