langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
changeset 1040 c0f5acfd9d15
parent 939 38e24969c7e9
child 1043 11ea4773b0af
equal deleted inserted replaced
1039:ca7b8a8c9268 1040:c0f5acfd9d15
    70     private final TreeMaker make;
    70     private final TreeMaker make;
    71     private final ClassReader reader;
    71     private final ClassReader reader;
    72     private final Todo todo;
    72     private final Todo todo;
    73     private final Annotate annotate;
    73     private final Annotate annotate;
    74     private final Types types;
    74     private final Types types;
       
    75     private final JCDiagnostic.Factory diags;
    75     private final Target target;
    76     private final Target target;
    76 
    77 
    77     private final boolean skipAnnotations;
    78     private final boolean skipAnnotations;
    78 
    79 
    79     public static MemberEnter instance(Context context) {
    80     public static MemberEnter instance(Context context) {
    94         make = TreeMaker.instance(context);
    95         make = TreeMaker.instance(context);
    95         reader = ClassReader.instance(context);
    96         reader = ClassReader.instance(context);
    96         todo = Todo.instance(context);
    97         todo = Todo.instance(context);
    97         annotate = Annotate.instance(context);
    98         annotate = Annotate.instance(context);
    98         types = Types.instance(context);
    99         types = Types.instance(context);
       
   100         diags = JCDiagnostic.Factory.instance(context);
    99         target = Target.instance(context);
   101         target = Target.instance(context);
   100         skipAnnotations =
   102         skipAnnotations =
   101             Options.instance(context).get("skipAnnotations") != null;
   103             Options.instance(context).get("skipAnnotations") != null;
   102     }
   104     }
   103 
   105 
   131                            Env<AttrContext> env) {
   133                            Env<AttrContext> env) {
   132         // Check that packages imported from exist (JLS ???).
   134         // Check that packages imported from exist (JLS ???).
   133         if (tsym.kind == PCK && tsym.members().elems == null && !tsym.exists()) {
   135         if (tsym.kind == PCK && tsym.members().elems == null && !tsym.exists()) {
   134             // If we can't find java.lang, exit immediately.
   136             // If we can't find java.lang, exit immediately.
   135             if (((PackageSymbol)tsym).fullname.equals(names.java_lang)) {
   137             if (((PackageSymbol)tsym).fullname.equals(names.java_lang)) {
   136                 JCDiagnostic msg = JCDiagnostic.fragment("fatal.err.no.java.lang");
   138                 JCDiagnostic msg = diags.fragment("fatal.err.no.java.lang");
   137                 throw new FatalError(msg);
   139                 throw new FatalError(msg);
   138             } else {
   140             } else {
   139                 log.error(pos, "doesnt.exist", tsym);
   141                 log.error(pos, "doesnt.exist", tsym);
   140             }
   142             }
   141         }
   143         }
   317                     importFrom(tsym);
   319                     importFrom(tsym);
   318                     if (!found) {
   320                     if (!found) {
   319                         log.error(pos, "cant.resolve.location",
   321                         log.error(pos, "cant.resolve.location",
   320                                   KindName.STATIC,
   322                                   KindName.STATIC,
   321                                   name, List.<Type>nil(), List.<Type>nil(),
   323                                   name, List.<Type>nil(), List.<Type>nil(),
   322                                   typeKindName(tsym.type),
   324                                   Kinds.typeKindName(tsym.type),
   323                                   tsym.type);
   325                                   tsym.type);
   324                     }
   326                     }
   325                 } finally {
   327                 } finally {
   326                     log.useSource(prev);
   328                     log.useSource(prev);
   327                 }
   329                 }