changeset 613:559c9a37d9f6

6955264: add option to suppress Abort in Check.completionError Reviewed-by: mcimadamore
author jjg
date Thu, 03 Jun 2010 17:14:20 -0700
parents 9a7c998bf2fc
children 852d8bb356bc
files src/share/classes/com/sun/tools/javac/comp/Check.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jun 02 19:08:47 2010 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jun 03 17:14:20 2010 -0700
@@ -64,6 +64,7 @@
     private final JCDiagnostic.Factory diags;
     private final boolean skipAnnotations;
     private boolean warnOnSyntheticConflicts;
+    private boolean suppressAbortOnBadClassFile;
     private final TreeInfo treeinfo;
 
     // The set of lint options currently in effect. It is initialized
@@ -98,6 +99,7 @@
         complexInference = options.get("-complexinference") != null;
         skipAnnotations = options.get("skipAnnotations") != null;
         warnOnSyntheticConflicts = options.get("warnOnSyntheticConflicts") != null;
+        suppressAbortOnBadClassFile = options.get("suppressAbortOnBadClassFile") != null;
 
         Target target = Target.instance(context);
         syntheticNameChar = target.syntheticNameChar();
@@ -210,7 +212,8 @@
      */
     public Type completionError(DiagnosticPosition pos, CompletionFailure ex) {
         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;
     }