< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java

Print this page
rev 48841 : [mq]: 8187950

@@ -144,10 +144,12 @@
 
     /** Factory for diagnostics
      */
     JCDiagnostic.Factory diagFactory;
 
+    DeferredCompletionFailureHandler dcfh;
+
     /** The current scope where type variables are entered.
      */
     protected WriteableScope typevars;
 
     private List<InterimUsesDirective> interimUses = List.nil();

@@ -258,10 +260,11 @@
         types = Types.instance(context);
         fileManager = context.get(JavaFileManager.class);
         if (fileManager == null)
             throw new AssertionError("FileManager initialization error");
         diagFactory = JCDiagnostic.Factory.instance(context);
+        dcfh = DeferredCompletionFailureHandler.instance(context);
 
         log = Log.instance(context);
 
         Options options = Options.instance(context);
         verbose         = options.isSet(Option.VERBOSE);

@@ -297,19 +300,21 @@
     public ClassFinder.BadClassFile badClassFile(String key, Object... args) {
         return new ClassFinder.BadClassFile (
             currentOwner.enclClass(),
             currentClassFile,
             diagFactory.fragment(key, args),
-            diagFactory);
+            diagFactory,
+            dcfh);
     }
 
     public ClassFinder.BadEnclosingMethodAttr badEnclosingMethod(Symbol sym) {
         return new ClassFinder.BadEnclosingMethodAttr (
             currentOwner.enclClass(),
             currentClassFile,
             diagFactory.fragment(Fragments.BadEnclosingMethod(sym)),
-            diagFactory);
+            diagFactory,
+            dcfh);
     }
 
 /************************************************************************
  * Buffer Access
  ***********************************************************************/

@@ -2661,11 +2666,11 @@
 
         // read flags, or skip if this is an inner class
         long f = nextChar();
         long flags = adjustClassFlags(f);
         if ((flags & MODULE) == 0) {
-            if (c.owner.kind == PCK) c.flags_field = flags;
+            if (c.owner.kind == PCK || c.owner.kind == ERR) c.flags_field = flags;
             // read own class name and check that it matches
             currentModule = c.packge().modle;
             ClassSymbol self = readClassSymbol(nextChar());
             if (c != self) {
                 throw badClassFile("class.file.wrong.class",

@@ -3063,11 +3068,13 @@
                 if (repeatable != null) {
                     deproxy = new AnnotationDeproxy(proxyOn);
                     theRepeatable = deproxy.deproxyCompound(repeatable);
                 }
             } catch (Exception e) {
-                throw new CompletionFailure(sym, ClassReader.this.diagFactory.fragment(Fragments.ExceptionMessage(e.getMessage())));
+                throw new CompletionFailure(sym,
+                                            ClassReader.this.diagFactory.fragment(Fragments.ExceptionMessage(e.getMessage())),
+                                            dcfh);
             }
 
             sym.getAnnotationTypeMetadata().setTarget(theTarget);
             sym.getAnnotationTypeMetadata().setRepeatable(theRepeatable);
         }
< prev index next >