Merge
authorlana
Thu, 04 Feb 2016 16:50:04 -0800
changeset 35737 3977b3940b92
parent 35734 8d9a72f04409 (current diff)
parent 35736 bae6ea327651 (diff)
child 35738 e6dad7431dd1
Merge
--- a/langtools/make/netbeans/langtools/nbproject/project.xml	Thu Feb 04 11:28:30 2016 -0800
+++ b/langtools/make/netbeans/langtools/nbproject/project.xml	Thu Feb 04 16:50:04 2016 -0800
@@ -520,7 +520,7 @@
                 <package-root>${root}/build/bootstrap/jdk.jshell/gensrc</package-root>
                 <package-root>${root}/../jdk/src/jdk.internal.le/share/classes</package-root>
                 <package-root>${root}/../jdk/src/jdk.jdi/share/classes</package-root>
-                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes:${root}/build/jdk.internal.le/aux:${root}/build/jdk.jdi/aux:${root}/build/jdk.internal.le/classes:${root}/build/jdk.jdi/classes</classpath>
+                <classpath mode="compile">${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes:${root}/build/jdk.internal.le/classes:${root}/build/jdk.jdi/classes</classpath>
                 <built-to>${root}/build/jdk.jshell/classes</built-to>
                 <source-level>1.8</source-level>
             </compilation-unit>
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java	Thu Feb 04 11:28:30 2016 -0800
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java	Thu Feb 04 16:50:04 2016 -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() + ")";
         }
--- a/langtools/test/jdk/jshell/DropTest.java	Thu Feb 04 11:28:30 2016 -0800
+++ b/langtools/test/jdk/jshell/DropTest.java	Thu Feb 04 16:50:04 2016 -0800
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8081431
  * @summary Test of JShell#drop().
  * @build KullaTesting TestingInputStream
  * @run testng DropTest
@@ -79,7 +80,6 @@
         assertActiveKeys();
     }
 
-    @Test(enabled = false) // TODO 8081431
     public void testDropImport() {
         PersistentSnippet imp = importKey(assertEval("import java.util.*;"));
         PersistentSnippet decl = varKey(
--- a/langtools/test/jdk/jshell/MethodsTest.java	Thu Feb 04 11:28:30 2016 -0800
+++ b/langtools/test/jdk/jshell/MethodsTest.java	Thu Feb 04 16:50:04 2016 -0800
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8080357
  * @summary Tests for EvaluationState.methods
  * @build KullaTesting TestingInputStream ExpectedDiagnostic
  * @run testng MethodsTest
@@ -36,7 +37,6 @@
 import org.testng.annotations.Test;
 
 import static jdk.jshell.Snippet.Status.*;
-import static jdk.jshell.Snippet.SubKind.*;
 
 @Test
 public class MethodsTest extends KullaTesting {
@@ -74,6 +74,15 @@
         assertMethodDeclSnippet(m1, "f", "(Bar)void", DROPPED, 1, 0);
     }
 
+    // 8080357
+    public void testNonReplUnresolved() {
+        // internal case
+        assertEval("class CCC {}", added(VALID));
+        assertEval("void f1() { CCC.xxxx(); }", added(RECOVERABLE_DEFINED));
+        // external case, not recoverable
+        assertDeclareFail("void f2() { System.xxxx(); }", "compiler.err.cant.resolve.location.args");
+    }
+
     public void methods() {
         assertEval("int x() { return 10; }");
         assertEval("String y() { return null; }");