1.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Wed Sep 04 14:44:05 2013 -0700 1.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Thu Sep 05 11:27:27 2013 +0200 1.3 @@ -72,7 +72,7 @@ 1.4 * This code and its internal interfaces are subject to change or 1.5 * deletion without notice.</b> 1.6 */ 1.7 -public class ClassReader implements Completer { 1.8 +public class ClassReader { 1.9 /** The context key for the class reader. */ 1.10 protected static final Context.Key<ClassReader> classReaderKey = 1.11 new Context.Key<ClassReader>(); 1.12 @@ -234,6 +234,17 @@ 1.13 */ 1.14 Set<Name> warnedAttrs = new HashSet<Name>(); 1.15 1.16 + /** 1.17 + * Completer that delegates to the complete-method of this class. 1.18 + */ 1.19 + private final Completer thisCompleter = new Completer() { 1.20 + @Override 1.21 + public void complete(Symbol sym) throws CompletionFailure { 1.22 + ClassReader.this.complete(sym); 1.23 + } 1.24 + }; 1.25 + 1.26 + 1.27 /** Get the ClassReader instance for this invocation. */ 1.28 public static ClassReader instance(Context context) { 1.29 ClassReader instance = context.get(classReaderKey); 1.30 @@ -264,8 +275,8 @@ 1.31 } 1.32 1.33 packages.put(names.empty, syms.rootPackage); 1.34 - syms.rootPackage.completer = this; 1.35 - syms.unnamedPackage.completer = this; 1.36 + syms.rootPackage.completer = thisCompleter; 1.37 + syms.unnamedPackage.completer = thisCompleter; 1.38 } 1.39 1.40 /** Construct a new class reader, optionally treated as the 1.41 @@ -2319,7 +2330,7 @@ 1.42 ClassSymbol c = new ClassSymbol(0, name, owner); 1.43 if (owner.kind == PCK) 1.44 Assert.checkNull(classes.get(c.flatname), c); 1.45 - c.completer = this; 1.46 + c.completer = thisCompleter; 1.47 return c; 1.48 } 1.49 1.50 @@ -2389,7 +2400,7 @@ 1.51 /** Completion for classes to be loaded. Before a class is loaded 1.52 * we make sure its enclosing class (if any) is loaded. 1.53 */ 1.54 - public void complete(Symbol sym) throws CompletionFailure { 1.55 + private void complete(Symbol sym) throws CompletionFailure { 1.56 if (sym.kind == TYP) { 1.57 ClassSymbol c = (ClassSymbol)sym; 1.58 c.members_field = new Scope.ErrorScope(c); // make sure it's always defined 1.59 @@ -2610,7 +2621,7 @@ 1.60 p = new PackageSymbol( 1.61 Convert.shortName(fullname), 1.62 enterPackage(Convert.packagePart(fullname))); 1.63 - p.completer = this; 1.64 + p.completer = thisCompleter; 1.65 packages.put(fullname, p); 1.66 } 1.67 return p;