< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java

Print this page
rev 56282 : [mq]: graal

*** 1,7 **** /* ! * Copyright (c) 2016, 2018, 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. --- 1,7 ---- /* ! * Copyright (c) 2016, 2019, 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.
*** 22,46 **** */ package org.graalvm.compiler.test; - import org.graalvm.compiler.serviceprovider.JavaVersionUtil; - /** * A class loader that exports all packages in the module defining the class loader to all classes * in the unnamed module associated with the loader. */ public class ExportingClassLoader extends ClassLoader { public ExportingClassLoader() { ! if (JavaVersionUtil.JAVA_SPEC > 8) { ! JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this)); ! } } public ExportingClassLoader(ClassLoader parent) { super(parent); ! if (JavaVersionUtil.JAVA_SPEC > 8) { ! JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this)); ! } } } --- 22,40 ---- */ package org.graalvm.compiler.test; /** * A class loader that exports all packages in the module defining the class loader to all classes * in the unnamed module associated with the loader. */ public class ExportingClassLoader extends ClassLoader { public ExportingClassLoader() { ! ModuleSupport.exportAllPackagesTo(getClass(), this); } public ExportingClassLoader(ClassLoader parent) { super(parent); ! ModuleSupport.exportAllPackagesTo(getClass(), this); } }
< prev index next >