private void checkForIssue(Symbol symbol, Multimap<String, Symbol> membersByName) {
   String name = symbol.name();
   for (String knownMemberName : membersByName.keySet()) {
     if (name.equalsIgnoreCase(knownMemberName)) {
       for (Symbol knownMemberSymbol : membersByName.get(knownMemberName)) {
         if (!symbol.equals(knownMemberSymbol)
             && isValidIssueLocation(symbol, knownMemberSymbol)
             && isInvalidMember(symbol, knownMemberSymbol)) {
           addIssue(
               symbol.declaration(),
               "Rename "
                   + getSymbolTypeName(symbol)
                   + " \""
                   + name
                   + "\" "
                   + "to prevent any misunderstanding/clash with "
                   + getSymbolTypeName(knownMemberSymbol)
                   + " \""
                   + knownMemberName
                   + "\" "
                   + "defined "
                   + getDefinitionPlace(symbol, knownMemberSymbol)
                   + ".");
           break;
         }
       }
     }
   }
 }
예제 #2
0
 private int fromInstance(Symbol symbol, Symbol owner) {
   int i = -1;
   Type ownerType = owner.type();
   for (Symbol outerClass : outerClasses) {
     i++;
     if (symbol.equals(outerClass)
         || (ownerType != null
             && owner.isTypeSymbol()
             && outerClass.type().isSubtypeOf(ownerType))) {
       return i;
     }
   }
   return -1;
 }