Closed dpalic closed 2 years ago
The problem seems to be your config file. It has an extra line that says:
<setting id="org.eclipse.jdt.core.javaFormatter" value="org.eclipse.jdt.core.defaultJavaFormatter"/>
When I export my config from Eclipse, I don't see that field anywhere, so I'm not sure how it got into your config file. When I remove it, your config file works fine.
Doesn't look like a bug with a valid config file. Information provided.
it is a exported config file (no manual addition to file), however this change fixes the issue
it is a exported config file (no manual addition to file), however this change fixes the issue
When I exported it, that line did not exist. However, you may be using a different version of Eclipse... or you may have attempted to export all of the formatter configs into a single file, rather than exporting a single one. To export a single config, click the Edit button, and not the "Export All" button:
Then, inside that config's edit window, click Export
Describe the bug A clear and concise description of what the bug is.
Versions (OS, Maven, Java, and others, as appropriate):
To Reproduce Steps to reproduce the behavior (or a link to an example repository that reproduces the problem):
XML is attached eclipse-java-formatter.xml.txt
run
mvn formatter:format
Expected behavior Get a formatted code
Exception
Context:
If I narrowed the issue down the Nullpointer comes from here:
So afaik Platform.getExtensionRegistry() is probably null, but now clue why...