equal
deleted
inserted
replaced
29 import java.util.*; |
29 import java.util.*; |
30 |
30 |
31 import javax.tools.JavaFileManager; |
31 import javax.tools.JavaFileManager; |
32 |
32 |
33 import com.sun.javadoc.*; |
33 import com.sun.javadoc.*; |
|
34 import com.sun.source.tree.CompilationUnitTree; |
34 import com.sun.source.util.JavacTask; |
35 import com.sun.source.util.JavacTask; |
35 import com.sun.source.util.TreePath; |
36 import com.sun.source.util.TreePath; |
36 import com.sun.tools.doclint.DocLint; |
37 import com.sun.tools.doclint.DocLint; |
37 import com.sun.tools.javac.api.BasicJavacTask; |
38 import com.sun.tools.javac.api.BasicJavacTask; |
38 import com.sun.tools.javac.code.*; |
39 import com.sun.tools.javac.code.*; |
814 return result; |
815 return result; |
815 } |
816 } |
816 |
817 |
817 void initDoclint(Collection<String> opts, Collection<String> customTagNames, String htmlVersion) { |
818 void initDoclint(Collection<String> opts, Collection<String> customTagNames, String htmlVersion) { |
818 ArrayList<String> doclintOpts = new ArrayList<>(); |
819 ArrayList<String> doclintOpts = new ArrayList<>(); |
819 |
820 boolean msgOptionSeen = false; |
820 for (String opt: opts) { |
821 |
821 doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt); |
822 for (String opt : opts) { |
822 } |
823 if (opt.startsWith(DocLint.XMSGS_OPTION)) { |
823 |
824 if (opt.equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) |
824 if (doclintOpts.isEmpty()) { |
825 return; |
|
826 msgOptionSeen = true; |
|
827 } |
|
828 doclintOpts.add(opt); |
|
829 } |
|
830 |
|
831 if (!msgOptionSeen) { |
825 doclintOpts.add(DocLint.XMSGS_OPTION); |
832 doclintOpts.add(DocLint.XMSGS_OPTION); |
826 } else if (doclintOpts.size() == 1 |
|
827 && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) { |
|
828 return; |
|
829 } |
833 } |
830 |
834 |
831 String sep = ""; |
835 String sep = ""; |
832 StringBuilder customTags = new StringBuilder(); |
836 StringBuilder customTags = new StringBuilder(); |
833 for (String customTag : customTagNames) { |
837 for (String customTag : customTagNames) { |
846 } |
850 } |
847 |
851 |
848 boolean showTagMessages() { |
852 boolean showTagMessages() { |
849 return (doclint == null); |
853 return (doclint == null); |
850 } |
854 } |
|
855 |
|
856 Map<CompilationUnitTree, Boolean> shouldCheck = new HashMap<>(); |
|
857 |
|
858 boolean shouldCheck(CompilationUnitTree unit) { |
|
859 return shouldCheck.computeIfAbsent(unit, doclint :: shouldCheck); |
|
860 } |
851 } |
861 } |