mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
6955264: add option to suppress Abort in Check.completionError
Reviewed-by: mcimadamore
This commit is contained in:
parent
fa91c4b435
commit
3bc126336f
1 changed files with 4 additions and 1 deletions
|
@ -64,6 +64,7 @@ public class Check {
|
||||||
private final JCDiagnostic.Factory diags;
|
private final JCDiagnostic.Factory diags;
|
||||||
private final boolean skipAnnotations;
|
private final boolean skipAnnotations;
|
||||||
private boolean warnOnSyntheticConflicts;
|
private boolean warnOnSyntheticConflicts;
|
||||||
|
private boolean suppressAbortOnBadClassFile;
|
||||||
private final TreeInfo treeinfo;
|
private final TreeInfo treeinfo;
|
||||||
|
|
||||||
// The set of lint options currently in effect. It is initialized
|
// The set of lint options currently in effect. It is initialized
|
||||||
|
@ -98,6 +99,7 @@ public class Check {
|
||||||
complexInference = options.get("-complexinference") != null;
|
complexInference = options.get("-complexinference") != null;
|
||||||
skipAnnotations = options.get("skipAnnotations") != null;
|
skipAnnotations = options.get("skipAnnotations") != null;
|
||||||
warnOnSyntheticConflicts = options.get("warnOnSyntheticConflicts") != null;
|
warnOnSyntheticConflicts = options.get("warnOnSyntheticConflicts") != null;
|
||||||
|
suppressAbortOnBadClassFile = options.get("suppressAbortOnBadClassFile") != null;
|
||||||
|
|
||||||
Target target = Target.instance(context);
|
Target target = Target.instance(context);
|
||||||
syntheticNameChar = target.syntheticNameChar();
|
syntheticNameChar = target.syntheticNameChar();
|
||||||
|
@ -210,7 +212,8 @@ public class Check {
|
||||||
*/
|
*/
|
||||||
public Type completionError(DiagnosticPosition pos, CompletionFailure ex) {
|
public Type completionError(DiagnosticPosition pos, CompletionFailure ex) {
|
||||||
log.error(pos, "cant.access", ex.sym, ex.getDetailValue());
|
log.error(pos, "cant.access", ex.sym, ex.getDetailValue());
|
||||||
if (ex instanceof ClassReader.BadClassFile) throw new Abort();
|
if (ex instanceof ClassReader.BadClassFile
|
||||||
|
&& !suppressAbortOnBadClassFile) throw new Abort();
|
||||||
else return syms.errType;
|
else return syms.errType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue