Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274734

the method jdk.jshell.SourceCodeAnalysis documentation not working

XMLWordPrintable

    • 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


            jlahoda Jan Lahoda
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: