Closed TalMat closed 2 years ago
Further info: This is using apex-ast-serializer.bat (windows machine) and the exit code is 1
The executionResult.stdout
json text ends abruptly. It is not complete/well-formed, probably due to being interrupted by an xstream
related error.
java -version
is java version "19.0.1" 2022-10-18
Hello, thank you for opening the bug report! This is new to me, and I think I need more info to debug this. Does this happen to one file, or does it happen to all files you're trying to format? Also, which Java distro are you using?
Another question - which version of Prettier Apex are you running?
I'm using the Oracle JRE installed from https://www.oracle.com/java/technologies/downloads/ (Java 19, Windows x64 MSI installer)
After creating a second .cls file to test, it appear it happens on a separate, single file as well. It also happens if there are multiple matched .cls files, though.
After updating from prettier-plugin-apex
1.8 to 1.11, the problem seems fixed. Thank you for such a prompt response, though. This formatting looks excellent!
When executing on a .cls file, I've received
Error: <partial json text>
This was not helpful, but did include a stack trace, and when poking around
parseTextWithSpawn
I noticed you're trying to checkexecutionResult.error
. It seems you are looking forexecutionResult.stderr
, in this case. At least, that gave me a more-specific (java-related) error, so I figured I'd share that here. I do not know what the issue is in particular, from there.executionResult.stderr.toString()
at `/src/parser.js line 30 contains the follow error text:`Exception in thread "main" com.thoughtworks.xstream.converters.ConversionException: No converter available ---- Debugging information ---- message : No converter available type : java.util.Optional converter : com.thoughtworks.xstream.converters.reflection.ReflectionConverter message[1] : Unable to make field private static final java.util.Optional java.util.Optional.EMPTY accessible: module java.base does not "opens java.util" to unnamed module @43df23d3