changeset 3238:81bd82222f8a jdk-9+105

Merge
author lana
date Thu, 04 Feb 2016 16:50:04 -0800
parents d10e29115134 873c5cde4f08
children 985b6b42a4ac 656b3aa4229f
files
diffstat 4 files changed, 29 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/make/netbeans/langtools/nbproject/project.xml	Thu Feb 04 11:28:30 2016 -0800
+++ b/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/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java	Thu Feb 04 11:28:30 2016 -0800
+++ b/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/test/jdk/jshell/DropTest.java	Thu Feb 04 11:28:30 2016 -0800
+++ b/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/test/jdk/jshell/MethodsTest.java	Thu Feb 04 11:28:30 2016 -0800
+++ b/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; }");