In JDK 9 a new nested class Runtime.Version has been introduced.
However, I cannot use it without using the fully qualified name:
(Runtime$Version/parse (System/getProperty "java.version"))
Syntax error compiling at ...
No such namespace: Runtime$Version
;; fully qualified name works
(java.lang.Runtime$Version/parse (System/getProperty "java.version"))
#object[java.lang.Runtime$Version 0x39a4ea03 "11.0.2"]
Is this intended?
I quickly tried this with another (private) nested class and it's the same behavior:
String$CaseInsensitiveComparator
Syntax error compiling ...
Unable to resolve symbol: String$CaseInsensitiveComparator in this context
The Java Interop reference says that nested classes can be accessed as Classname$NestedClassName
and doesn't mention this issue specifically.
It does look a bit inconsistent to me.
To be fair, I can still import the nested class and use it - but this is something I didn't expect I had to do:
(import 'java.lang.Runtime$Version)
(Runtime$Version/parse (System/getProperty "java.version"))
#object[java.lang.Runtime$Version 0x781187fa "11.0.2"]