langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 24296 296e59a84663
parent 24219 e7dc661cafae
child 24396 3c36c6afcbca
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed May 07 23:55:41 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu May 08 00:22:31 2014 +0200
@@ -3214,6 +3214,14 @@
         result = checkId(tree, env1.enclClass.sym.type, sym, env, resultInfo);
     }
 
+    /** Report dependencies.
+     * @param from The enclosing class sym
+     * @param to   The found identifier that the class depends on.
+     */
+    public void reportDependence(Symbol from, Symbol to) {
+        // Override if you want to collect the reported dependencies.
+    }
+
     public void visitSelect(JCFieldAccess tree) {
         // Determine the expected kind of the qualifier expression.
         int skind = 0;
@@ -3341,6 +3349,10 @@
 
         env.info.selectSuper = selectSuperPrev;
         result = checkId(tree, site, sym, env, resultInfo);
+
+        if ((tree.sym.kind & TYP) != 0) {
+            reportDependence(env.enclClass.sym, tree.sym);
+        }
     }
     //where
         /** Determine symbol referenced by a Select expression,