File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
dom/org/eclipse/jdt/core/dom
model/org/eclipse/jdt/internal/core Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,21 @@ public void setResolveBindings(boolean enabled) {
486486 }
487487 }
488488
489+ /**
490+ * Requests for the compiler to force problem detection (such as extra analysis
491+ * or linting configured in project).
492+ * @param enabled <code>true</code> if problems are wanted, and <code>false</code>
493+ * if problems are not of interest.
494+ * @since 3.44
495+ */
496+ public void setForceProblemDetection (boolean enabled ) {
497+ if (enabled ) {
498+ this .bits |= CompilationUnitResolver .FORCE_PROBLEM_DETECTION ;
499+ } else {
500+ this .bits &= ~CompilationUnitResolver .FORCE_PROBLEM_DETECTION ;
501+ }
502+ }
503+
489504 /**
490505 * Requests an abridged abstract syntax tree.
491506 * By default, complete ASTs are returned.
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ public static synchronized ICompilationUnitResolver getInstance() {
126126 public static final int IGNORE_METHOD_BODIES = 0x8 ;
127127 public static final int BINDING_RECOVERY = 0x10 ;
128128 public static final int INCLUDE_RUNNING_VM_BOOTCLASSPATH = 0x20 ;
129+ public static final int FORCE_PROBLEM_DETECTION = 0x40 ;
129130
130131 /* A list of int */
131132 static class IntArrayList {
Original file line number Diff line number Diff line change @@ -202,8 +202,9 @@ public org.eclipse.jdt.core.dom.CompilationUnit makeConsistent(CompilationUnit w
202202 if (CompilationUnit .DOM_BASED_OPERATIONS ) {
203203 try {
204204 ASTParser parser = ASTParser .newParser (this .astLevel > 0 ? this .astLevel : AST .getJLSLatest ());
205- parser .setResolveBindings (this .resolveBindings || ( this . reconcileFlags & ICompilationUnit . FORCE_PROBLEM_DETECTION ) != 0 );
205+ parser .setResolveBindings (this .resolveBindings );
206206 parser .setCompilerOptions (options );
207+ parser .setForceProblemDetection ((this .reconcileFlags & ICompilationUnit .FORCE_PROBLEM_DETECTION ) != 0 );
207208 parser .setSource (source );
208209 org .eclipse .jdt .core .dom .CompilationUnit newAST = (org .eclipse .jdt .core .dom .CompilationUnit ) parser .createAST (this .progressMonitor );
209210 if ((this .reconcileFlags & ICompilationUnit .FORCE_PROBLEM_DETECTION ) != 0 && newAST != null ) {
You can’t perform that action at this time.
0 commit comments