--- old/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java 2016-01-28 23:45:04.475059143 -0800 +++ new/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java 2016-01-28 23:45:04.395057196 -0800 @@ -31,6 +31,7 @@ import javax.tools.Diagnostic; import javax.tools.JavaFileObject; import jdk.jshell.MemoryFileManager.SourceMemoryJavaFileObject; +import static jdk.internal.jshell.debug.InternalDebugControl.DBG_GEN; /** * @@ -183,6 +184,22 @@ } @Override + boolean isResolutionError() { + if (!super.isResolutionError()) { + return false; + } + for (String line : diag.getMessage(PARSED_LOCALE).split("\\r?\\n")) { + if (line.trim().startsWith("location:")) { + if (!line.contains(REPL_CLASS_PREFIX)) { + // Resolution error must occur within a REPL class or it is not resolvable + return false; + } + } + } + return true; + } + + @Override public String toString() { return "WrappedDiagnostic(" + getMessage(null) + ":" + getPosition() + ")"; }