2081 else if (sym.kind < bestSoFar.kind) bestSoFar = sym; |
2081 else if (sym.kind < bestSoFar.kind) bestSoFar = sym; |
2082 } |
2082 } |
2083 |
2083 |
2084 if ((kind & TYP) != 0) { |
2084 if ((kind & TYP) != 0) { |
2085 sym = findType(env, name); |
2085 sym = findType(env, name); |
2086 if (sym.kind==TYP) { |
|
2087 reportDependence(env.enclClass.sym, sym); |
|
2088 } |
|
2089 if (sym.exists()) return sym; |
2086 if (sym.exists()) return sym; |
2090 else if (sym.kind < bestSoFar.kind) bestSoFar = sym; |
2087 else if (sym.kind < bestSoFar.kind) bestSoFar = sym; |
2091 } |
2088 } |
2092 |
2089 |
2093 if ((kind & PCK) != 0) return syms.enterPackage(name); |
2090 if ((kind & PCK) != 0) return syms.enterPackage(name); |
2094 else return bestSoFar; |
2091 else return bestSoFar; |
2095 } |
|
2096 |
|
2097 /** Report dependencies. |
|
2098 * @param from The enclosing class sym |
|
2099 * @param to The found identifier that the class depends on. |
|
2100 */ |
|
2101 public void reportDependence(Symbol from, Symbol to) { |
|
2102 // Override if you want to collect the reported dependencies. |
|
2103 } |
2092 } |
2104 |
2093 |
2105 /** Find an identifier in a package which matches a specified kind set. |
2094 /** Find an identifier in a package which matches a specified kind set. |
2106 * @param env The current environment. |
2095 * @param env The current environment. |
2107 * @param name The identifier's name. |
2096 * @param name The identifier's name. |