-
Bug
-
Resolution: Fixed
-
P4
-
17, 18
-
b23
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The method jdk.jshell.SourceCodeAnalysis documentation(String input, int cursor, boolean computeJavadoc) returns empty list for jdk.jshell.JShell when another SourceCodeAnalysis is already used for documentation.
The problem is in the method jdk.shell.SourceCodeAnalysisImpl List<Path> findSources()
The first SourceCodeAnalysis opens file system and keeps it open.
The second SourceCodeAnalysis tries to open the file system and fails.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expected that JShell instances are independent and it is possible to use multiple JShell instances in the same application.
---------- BEGIN SOURCE ----------
import java.util.List;
import jdk.jshell.JShell;
import jdk.jshell.SourceCodeAnalysis.Documentation;
public class Test {
public static void main(String[] args) {
JShell jsh1 = JShell.create();
List<Documentation> docs1 = jsh1.sourceCodeAnalysis().documentation("String",
6, false);
System.out.println(docs1.get(0).signature());
JShell jsh2 = JShell.create();
List<Documentation> docs2 = jsh2.sourceCodeAnalysis().documentation("String",
6, false);
System.out.println(docs2);
}
}
---------- END SOURCE ----------
FREQUENCY : always
The method jdk.jshell.SourceCodeAnalysis documentation(String input, int cursor, boolean computeJavadoc) returns empty list for jdk.jshell.JShell when another SourceCodeAnalysis is already used for documentation.
The problem is in the method jdk.shell.SourceCodeAnalysisImpl List<Path> findSources()
The first SourceCodeAnalysis opens file system and keeps it open.
The second SourceCodeAnalysis tries to open the file system and fails.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expected that JShell instances are independent and it is possible to use multiple JShell instances in the same application.
---------- BEGIN SOURCE ----------
import java.util.List;
import jdk.jshell.JShell;
import jdk.jshell.SourceCodeAnalysis.Documentation;
public class Test {
public static void main(String[] args) {
JShell jsh1 = JShell.create();
List<Documentation> docs1 = jsh1.sourceCodeAnalysis().documentation("String",
6, false);
System.out.println(docs1.get(0).signature());
JShell jsh2 = JShell.create();
List<Documentation> docs2 = jsh2.sourceCodeAnalysis().documentation("String",
6, false);
System.out.println(docs2);
}
}
---------- END SOURCE ----------
FREQUENCY : always