< prev index next >

src/java.base/share/classes/java/net/URLClassLoader.java

Print this page
rev 15908 : 8165271: Fix use of reflection to gain access to private fields
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 49,58 **** --- 49,60 ---- import java.util.jar.JarFile; import java.util.jar.Manifest; import jdk.internal.loader.Resource; import jdk.internal.loader.URLClassPath; + import jdk.internal.misc.JavaNetUrlClassLoaderAccess; + import jdk.internal.misc.SharedSecrets; import jdk.internal.perf.PerfCounter; import sun.net.www.ParseUtil; import sun.security.util.SecurityConstants; /**
*** 763,772 **** --- 765,782 ---- }); return ucl; } static { + SharedSecrets.setJavaNetUrlClassLoaderAccess( + new JavaNetUrlClassLoaderAccess() { + @Override + public AccessControlContext getAccessControlContext(URLClassLoader u) { + return u.acc; + } + } + ); ClassLoader.registerAsParallelCapable(); } } final class FactoryURLClassLoader extends URLClassLoader {
< prev index next >