< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java

Print this page
rev 3947 : imported patch xmodule-to-patch-module

@@ -551,11 +551,27 @@
 
         String packageName = p.fullname.toString();
 
         Location classLocn = msym.classLocation;
         Location sourceLocn = msym.sourceLocation;
+        Location patchLocn = msym.patchLocation;
 
+        boolean prevPreferCurrent = preferCurrent;
+
+        try {
+            preferCurrent = false;
+            if ((wantClassFiles || wantSourceFiles) && (patchLocn != null)) {
+                Set<JavaFileObject.Kind> combined = EnumSet.noneOf(JavaFileObject.Kind.class);
+                combined.addAll(classKinds);
+                combined.addAll(sourceKinds);
+                fillIn(p, patchLocn,
+                       list(patchLocn,
+                            p,
+                            packageName,
+                            combined));
+            }
+            preferCurrent = true;
         if (wantClassFiles && (classLocn != null)) {
             fillIn(p, classLocn,
                    list(classLocn,
                         p,
                         packageName,

@@ -566,10 +582,13 @@
                    list(sourceLocn,
                         p,
                         packageName,
                         sourceKinds));
         }
+        } finally {
+            preferCurrent = prevPreferCurrent;
+        }
     }
 
     /**
      * Scans class path and source path for files in given package.
      */
< prev index next >