src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java

changeset 2906
d3a51adc115f
parent 1706
95d29b99e5b3
child 3295
859dc787b52b
     1.1 --- a/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java	Wed Sep 16 10:56:23 2015 +0200
     1.2 +++ b/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java	Mon Sep 28 16:56:26 2015 +0200
     1.3 @@ -128,7 +128,7 @@
     1.4               t.hasTag(CLASS);
     1.5               t = env.types.supertype(t)) {
     1.6              ClassSymbol c = (ClassSymbol)t.tsym;
     1.7 -            for (Scope.Entry e = c.members().lookup(sym.name); e.scope != null; e = e.next()) {
     1.8 +            for (Scope.Entry e = membersOf(c).lookup(sym.name); e.scope != null; e = e.next()) {
     1.9                  if (sym.overrides(e.sym, origin, env.types, true)) {
    1.10                      return TypeMaker.getType(env, t);
    1.11                  }
    1.12 @@ -160,7 +160,7 @@
    1.13               t.hasTag(CLASS);
    1.14               t = env.types.supertype(t)) {
    1.15              ClassSymbol c = (ClassSymbol)t.tsym;
    1.16 -            for (Scope.Entry e = c.members().lookup(sym.name); e.scope != null; e = e.next()) {
    1.17 +            for (Scope.Entry e = membersOf(c).lookup(sym.name); e.scope != null; e = e.next()) {
    1.18                  if (sym.overrides(e.sym, origin, env.types, true)) {
    1.19                      return env.getMethodDoc((MethodSymbol)e.sym);
    1.20                  }
    1.21 @@ -169,6 +169,19 @@
    1.22          return null;
    1.23      }
    1.24  
    1.25 +    /**Retrieve members of c, ignoring any CompletionFailures that occur. */
    1.26 +    private Scope membersOf(ClassSymbol c) {
    1.27 +        try {
    1.28 +            return c.members();
    1.29 +        } catch (CompletionFailure cf) {
    1.30 +            /* Quietly ignore completion failures and try again - the type
    1.31 +             * for which the CompletionFailure was thrown shouldn't be completed
    1.32 +             * again by the completer that threw the CompletionFailure.
    1.33 +             */
    1.34 +            return membersOf(c);
    1.35 +        }
    1.36 +    }
    1.37 +
    1.38      /**
    1.39       * Tests whether this method overrides another.
    1.40       * The overridden method may be one declared in a superclass or

mercurial