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

JShell API: convert query responses to Stream instead of List/Collection

XMLWordPrintable

    • b132
    • Verified

      Several JShell API queries return transient values as lists. These lists are then often streamed over. A previous API review requested several queries be converted to return Stream. Two of the below are non-transient and are side-effected (cannot be trivially repeated) thus I am excluding them: eval() and drop(). An imports() query has been added since this request. This leaves --

      Stream<Snippet> snippets()
      Stream<VarSnippet> variables()
      Stream<MethodSnippet> methods()
      Stream<TypeDeclSnippet> types()
      Stream<ImportSnippet> imports()
      Stream<Diag> diagnostics(Snippet snippet)
      Stream<String> unresolvedDependencies(DeclarationSnippet snippet)


      Original request --
      Stream<Diag> diagnostics(Snippet snippet)
      Stream<SnippetEvent> drop(PersistentSnippet snippet)
      Stream<SnippetEvent> eval(java.lang.String input)
      Stream<MethodSnippet> methods()
      Stream<Snippet> snippets()
      Stream<TypeDeclSnippet> types()
      Stream<java.lang.String> unresolvedDependencies(DeclarationSnippet snippet)
      Stream<VarSnippet> variables()

            rfield Robert Field (Inactive)
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: