Hello,
I have a problem with JShell, I don’t know if it should go in this mailing list.
On JDK 21 (should be the same for any JDK version 9+), Windows 11, with this 
following code :
```
var jshell = JShell.create() ;
jshell.sourceCodeAnalysis().analyzeCompletion("println(").source() // null
```
this second line returns null, but the doc of 
SourceCodeAnalysis.CompletionInfo#source() says this:
```
Source code for the first Snippet of code input. For example, first statement, 
or first method declaration. Trailing semicolons will be added, as needed.
Returns:
the source of the first encountered Snippet
```
There is no mention that it can return null.
Yes it can makes sense to return null (well actually yesn’t since from what 
I’ve seen from the source code, it’s only null if it is incomplete, it’s not 
null even if it is unknown), since I gave an invalid snippet, but the doc 
should at least mention it.

Regards,
Tom.

Reply via email to