Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7036906

Scope: CompoundScope.getElements() doesn't pass scope filter to subscopes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 7
    • 7
    • tools
    • b142
    • unknown
    • generic
    • Verified

      The method CompoundScope.getElements doesn't pass the scope filter to subscopes when scanning members of a given class; look at the code:

      @Override
              public Iterable<Symbol> getElements(final Filter<Symbol> sf) {
                  return new Iterable<Symbol>() {
                      public Iterator<Symbol> iterator() {
                          return new CompoundScopeIterator(subScopes) {
                              Iterator<Symbol> nextIterator(Scope s) {
                                  return s.getElements().iterator(); //PROBLEM
                              }
                          };
                      }
                  };
              }

      The problematic line should be:

           return s.getElements(***sf***).iterator(); //PROBLEM

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: