langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/Dependencies.java
changeset 26107 a4a156a33c94
parent 26104 34de7e01b3c1
parent 25874 83c19f00452c
equal deleted inserted replaced
25876:d06a6d3c66c0 26107:a4a156a33c94
    32 import java.util.HashSet;
    32 import java.util.HashSet;
    33 import java.util.Map;
    33 import java.util.Map;
    34 import java.util.Set;
    34 import java.util.Set;
    35 
    35 
    36 import com.sun.tools.javac.code.Symbol.ClassSymbol;
    36 import com.sun.tools.javac.code.Symbol.ClassSymbol;
       
    37 import com.sun.tools.javac.util.Assert;
    37 import com.sun.tools.javac.util.Context;
    38 import com.sun.tools.javac.util.Context;
    38 import com.sun.tools.javac.util.Log;
    39 import com.sun.tools.javac.util.Log;
    39 import com.sun.tools.javac.util.Name;
    40 import com.sun.tools.javac.util.Name;
    40 
    41 
    41 /** Utility class containing dependency information between packages
    42 /** Utility class containing dependency information between packages
    42  *  and the pubapi for a package.
    43  *  and the pubapi for a package.
    43  *
    44  *
    44  * <p><b>This is NOT part of any supported API.
    45  *  <p><b>This is NOT part of any supported API.
    45  * If you write code that depends on this, you do so at your own
    46  *  If you write code that depends on this, you do so at your own risk.
    46  * risk.  This code and its internal interfaces are subject to change
    47  *  This code and its internal interfaces are subject to change or
    47  * or deletion without notice.</b></p>
    48  *  deletion without notice.</b>
    48  */
    49  */
    49 public class Dependencies {
    50 public class Dependencies {
    50     protected static final Context.Key<Dependencies> dependenciesKey = new Context.Key<>();
    51     protected static final Context.Key<Dependencies> dependenciesKey = new Context.Key<>();
    51 
    52 
    52     // The log to be used for error reporting.
    53     // The log to be used for error reporting.
   152      */
   153      */
   153     public void visitPubapi(Element e) {
   154     public void visitPubapi(Element e) {
   154         Name n = ((ClassSymbol)e).fullname;
   155         Name n = ((ClassSymbol)e).fullname;
   155         Name p = ((ClassSymbol)e).packge().fullname;
   156         Name p = ((ClassSymbol)e).packge().fullname;
   156         StringBuffer sb = publicApiPerClass.get(n);
   157         StringBuffer sb = publicApiPerClass.get(n);
   157         assert(sb == null);
   158         Assert.check(sb == null);
   158         sb = new StringBuffer();
   159         sb = new StringBuffer();
   159         PubapiVisitor v = new PubapiVisitor(sb);
   160         PubapiVisitor v = new PubapiVisitor(sb);
   160         v.visit(e);
   161         v.visit(e);
   161         if (sb.length()>0) {
   162         if (sb.length()>0) {
   162             publicApiPerClass.put(n, sb);
   163             publicApiPerClass.put(n, sb);