@@ -210,25 +210,26 @@ private[hive] class IsolatedClientLoader(
210210 private [hive] val classLoader : MutableURLClassLoader = {
211211 val isolatedClassLoader =
212212 if (isolationOn) {
213- val rootClassLoader : ClassLoader =
214- if (SystemUtils .isJavaVersionAtLeast(JavaVersion .JAVA_9 )) {
215- // In Java 9, the boot classloader can see few JDK classes. The intended parent
216- // classloader for delegation is now the platform classloader.
217- // See http://java9.wtf/class-loading/
218- val platformCL =
219- classOf [ClassLoader ].getMethod(" getPlatformClassLoader" ).
220- invoke(null ).asInstanceOf [ClassLoader ]
221- // Check to make sure that the root classloader does not know about Hive.
222- assert(Try (platformCL.loadClass(" org.apache.hadoop.hive.conf.HiveConf" )).isFailure)
223- platformCL
224- } else {
225- // The boot classloader is represented by null (the instance itself isn't accessible)
226- // and before Java 9 can see all JDK classes
227- null
228- }
229213 if (allJars.isEmpty) {
230- rootClassLoader
214+ // See HiveUtils; this is the Java 9+ + builtin mode scenario
215+ baseClassLoader
231216 } else {
217+ val rootClassLoader : ClassLoader =
218+ if (SystemUtils .isJavaVersionAtLeast(JavaVersion .JAVA_9 )) {
219+ // In Java 9, the boot classloader can see few JDK classes. The intended parent
220+ // classloader for delegation is now the platform classloader.
221+ // See http://java9.wtf/class-loading/
222+ val platformCL =
223+ classOf [ClassLoader ].getMethod(" getPlatformClassLoader" ).
224+ invoke(null ).asInstanceOf [ClassLoader ]
225+ // Check to make sure that the root classloader does not know about Hive.
226+ assert(Try (platformCL.loadClass(" org.apache.hadoop.hive.conf.HiveConf" )).isFailure)
227+ platformCL
228+ } else {
229+ // The boot classloader is represented by null (the instance itself isn't accessible)
230+ // and before Java 9 can see all JDK classes
231+ null
232+ }
232233 new URLClassLoader (allJars, rootClassLoader) {
233234 override def loadClass (name : String , resolve : Boolean ): Class [_] = {
234235 val loaded = findLoadedClass(name)
0 commit comments