src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java

Print this page

        

*** 29,38 **** --- 29,39 ---- import static jdk.jshell.Util.*; import java.util.Locale; import javax.tools.Diagnostic; import javax.tools.JavaFileObject; import jdk.jshell.MemoryFileManager.SourceMemoryJavaFileObject; + import static jdk.internal.jshell.debug.InternalDebugControl.DBG_GEN; /** * * @author Robert Field */
*** 181,190 **** --- 182,207 ---- } return null; } @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() + ")"; } } }