langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocEnter.java
changeset 43269 12f989542165
parent 42827 36468b5fa7f4
equal deleted inserted replaced
43268:12436ebea906 43269:12f989542165
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    34 import com.sun.tools.javac.util.Context;
    34 import com.sun.tools.javac.util.Context;
    35 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
    35 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
    36 import com.sun.tools.javac.util.List;
    36 import com.sun.tools.javac.util.List;
    37 
    37 
    38 import static com.sun.tools.javac.code.Kinds.Kind.*;
    38 import static com.sun.tools.javac.code.Kinds.Kind.*;
       
    39 import com.sun.tools.javac.main.JavaCompiler;
    39 
    40 
    40 /**
    41 /**
    41  *  Javadoc's own enter phase does a few things above and beyond that
    42  *  Javadoc's own enter phase does a few things above and beyond that
    42  *  done by javac.
    43  *  done by javac.
    43  *
    44  *
    63 
    64 
    64     protected JavadocEnter(Context context) {
    65     protected JavadocEnter(Context context) {
    65         super(context);
    66         super(context);
    66         messager = Messager.instance0(context);
    67         messager = Messager.instance0(context);
    67         docenv = DocEnv.instance(context);
    68         docenv = DocEnv.instance(context);
       
    69         compiler = JavaCompiler.instance(context);
    68     }
    70     }
    69 
    71 
    70     final Messager messager;
    72     final Messager messager;
    71     final DocEnv docenv;
    73     final DocEnv docenv;
       
    74     final JavaCompiler compiler;
    72 
    75 
    73     @Override
    76     @Override
    74     public void main(List<JCCompilationUnit> trees) {
    77     public void main(List<JCCompilationUnit> trees) {
    75         // count all Enter errors as warnings.
    78         // count all Enter errors as warnings.
    76         int nerrors = messager.nerrors;
    79         int nerrors = messager.nerrors;
    77         super.main(trees);
    80         super.main(trees);
       
    81         compiler.enterDone();
    78         messager.nwarnings += (messager.nerrors - nerrors);
    82         messager.nwarnings += (messager.nerrors - nerrors);
    79         messager.nerrors = nerrors;
    83         messager.nerrors = nerrors;
    80     }
    84     }
    81 
    85 
    82     @Override
    86     @Override