6955264: add option to suppress Abort in Check.completionError

Thu, 03 Jun 2010 17:14:20 -0700

author
jjg
date
Thu, 03 Jun 2010 17:14:20 -0700
changeset 576
559c9a37d9f6
parent 575
9a7c998bf2fc
child 577
852d8bb356bc

6955264: add option to suppress Abort in Check.completionError
Reviewed-by: mcimadamore

src/share/classes/com/sun/tools/javac/comp/Check.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jun 02 19:08:47 2010 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jun 03 17:14:20 2010 -0700
     1.3 @@ -64,6 +64,7 @@
     1.4      private final JCDiagnostic.Factory diags;
     1.5      private final boolean skipAnnotations;
     1.6      private boolean warnOnSyntheticConflicts;
     1.7 +    private boolean suppressAbortOnBadClassFile;
     1.8      private final TreeInfo treeinfo;
     1.9  
    1.10      // The set of lint options currently in effect. It is initialized
    1.11 @@ -98,6 +99,7 @@
    1.12          complexInference = options.get("-complexinference") != null;
    1.13          skipAnnotations = options.get("skipAnnotations") != null;
    1.14          warnOnSyntheticConflicts = options.get("warnOnSyntheticConflicts") != null;
    1.15 +        suppressAbortOnBadClassFile = options.get("suppressAbortOnBadClassFile") != null;
    1.16  
    1.17          Target target = Target.instance(context);
    1.18          syntheticNameChar = target.syntheticNameChar();
    1.19 @@ -210,7 +212,8 @@
    1.20       */
    1.21      public Type completionError(DiagnosticPosition pos, CompletionFailure ex) {
    1.22          log.error(pos, "cant.access", ex.sym, ex.getDetailValue());
    1.23 -        if (ex instanceof ClassReader.BadClassFile) throw new Abort();
    1.24 +        if (ex instanceof ClassReader.BadClassFile
    1.25 +                && !suppressAbortOnBadClassFile) throw new Abort();
    1.26          else return syms.errType;
    1.27      }
    1.28  

mercurial