Skip to content

Commit

Permalink
Ignoring Javadoc of depedencies
Browse files Browse the repository at this point in the history
When resolving, we do only need the symbols/bindings of depedencies.
Minimize the amount of option to skip eg parsing Javadoc for transitive
files that are only relevant as part of binding resolution.
  • Loading branch information
mickaelistria committed Nov 15, 2024
1 parent e7edd84 commit 6ede6ab
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,18 @@ public Void visitClass(ClassTree node, Void p) {
List<JCCompilationUnit> javacCompilationUnits = new ArrayList<>();
try {
var elements = task.parse().iterator();
// after parsing, we already have the comments and we don't care about reading other comments
// during resolution
{
// The tree we have are complete and good enough for further processing.
// Disable extra features that can affect how other trees (source path elements)
// are parsed during resolution so we stick to the mininal useful data generated
// and stored during analysis
var javac = com.sun.tools.javac.main.JavaCompiler.instance(context);
javac.keepComments = false;
javac.genEndPos = false;
javac.lineDebugInfo = false;
}
var aptPath = fileManager.getLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH);
if ((flags & ICompilationUnit.FORCE_PROBLEM_DETECTION) != 0
|| (aptPath != null && aptPath.iterator().hasNext())) {
Expand Down

0 comments on commit 6ede6ab

Please sign in to comment.