File: 0015-java9-compatibility.patch

package info (click to toggle)
scala 2.11.12-5
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 62,828 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,250; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (23 lines) | stat: -rw-r--r-- 1,215 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: Fixes the compatibility with Java 9
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala
+++ b/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala
@@ -90,7 +90,7 @@
     }
   }
 
-  private val packages = mutable.Map[String, Package]()
+  private val _packages = mutable.Map[String, Package]()
 
   override def definePackage(name: String, specTitle: String, specVersion: String, specVendor: String, implTitle: String, implVersion: String, implVendor: String, sealBase: URL): Package = {
     throw new UnsupportedOperationException()
@@ -98,7 +98,7 @@
 
   override def getPackage(name: String): Package = findAbstractDir(name) match {
     case null => super.getPackage(name)
-    case file => packages.getOrElseUpdate(name, {
+    case file => _packages.getOrElseUpdate(name, {
       val ctor = classOf[Package].getDeclaredConstructor(classOf[String], classOf[String], classOf[String], classOf[String], classOf[String], classOf[String], classOf[String], classOf[URL], classOf[ClassLoader])
       ctor.setAccessible(true)
       ctor.newInstance(name, null, null, null, null, null, null, null, this)