langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
changeset 21043 3b000be15694
parent 21040 3e32f68d2151
child 22163 3651128c74eb
equal deleted inserted replaced
21042:2b4b55bc044d 21043:3b000be15694
  2403             return enterClass(flatname, (JavaFileObject)null);
  2403             return enterClass(flatname, (JavaFileObject)null);
  2404         else
  2404         else
  2405             return c;
  2405             return c;
  2406     }
  2406     }
  2407 
  2407 
  2408     private boolean suppressFlush = false;
       
  2409 
       
  2410     /** Completion for classes to be loaded. Before a class is loaded
  2408     /** Completion for classes to be loaded. Before a class is loaded
  2411      *  we make sure its enclosing class (if any) is loaded.
  2409      *  we make sure its enclosing class (if any) is loaded.
  2412      */
  2410      */
  2413     private void complete(Symbol sym) throws CompletionFailure {
  2411     private void complete(Symbol sym) throws CompletionFailure {
  2414         if (sym.kind == TYP) {
  2412         if (sym.kind == TYP) {
  2415             ClassSymbol c = (ClassSymbol)sym;
  2413             ClassSymbol c = (ClassSymbol)sym;
  2416             c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
  2414             c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
  2417             boolean saveSuppressFlush = suppressFlush;
  2415             annotate.enterStart();
  2418             suppressFlush = true;
       
  2419             try {
  2416             try {
  2420                 completeOwners(c.owner);
  2417                 completeOwners(c.owner);
  2421                 completeEnclosing(c);
  2418                 completeEnclosing(c);
  2422             } finally {
  2419             } finally {
  2423                 suppressFlush = saveSuppressFlush;
  2420                 // The flush needs to happen only after annotations
       
  2421                 // are filled in.
       
  2422                 annotate.enterDoneWithoutFlush();
  2424             }
  2423             }
  2425             fillIn(c);
  2424             fillIn(c);
  2426         } else if (sym.kind == PCK) {
  2425         } else if (sym.kind == PCK) {
  2427             PackageSymbol p = (PackageSymbol)sym;
  2426             PackageSymbol p = (PackageSymbol)sym;
  2428             try {
  2427             try {
  2429                 fillIn(p);
  2428                 fillIn(p);
  2430             } catch (IOException ex) {
  2429             } catch (IOException ex) {
  2431                 throw new CompletionFailure(sym, ex.getLocalizedMessage()).initCause(ex);
  2430                 throw new CompletionFailure(sym, ex.getLocalizedMessage()).initCause(ex);
  2432             }
  2431             }
  2433         }
  2432         }
  2434         if (!filling && !suppressFlush)
  2433         if (!filling)
  2435             annotate.flush(); // finish attaching annotations
  2434             annotate.flush(); // finish attaching annotations
  2436     }
  2435     }
  2437 
  2436 
  2438     /** complete up through the enclosing package. */
  2437     /** complete up through the enclosing package. */
  2439     private void completeOwners(Symbol o) {
  2438     private void completeOwners(Symbol o) {