8141415: JShell: wrap erroneous with one-liner comment-outed imports
Reviewed-by: rfield
This commit is contained in:
parent
58de940c2f
commit
3ff9cf19e2
@ -101,6 +101,6 @@ public class ImportSnippet extends PersistentSnippet {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
String importLine(JShell state) {
|
String importLine(JShell state) {
|
||||||
return source();
|
return guts().wrapped();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
|
* @bug 8141415
|
||||||
* @summary Test imports
|
* @summary Test imports
|
||||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
* @modules jdk.compiler/com.sun.tools.javac.api
|
||||||
* jdk.compiler/com.sun.tools.javac.main
|
* jdk.compiler/com.sun.tools.javac.main
|
||||||
@ -162,4 +163,9 @@ public class ImportTest extends KullaTesting {
|
|||||||
assertEval("field;", "\"A\"");
|
assertEval("field;", "\"A\"");
|
||||||
assertEval("method();", "\"A\"");
|
assertEval("method();", "\"A\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testImportWithComment() {
|
||||||
|
assertImportKeyMatch("import java.util.List;//comment", "List", SINGLE_TYPE_IMPORT_SUBKIND, added(VALID));
|
||||||
|
assertEval("List l = null;");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user