Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message in IntelliJ : "Loaded only <X> properties from: <an_epf_file>, should be 100+" #211

Open
Great-Fred opened this issue Jul 6, 2020 · 7 comments

Comments

@Great-Fred
Copy link

Great-Fred commented Jul 6, 2020

Hello,

I have a problem with an ".epf" file exported from STS4 (based on a version of Eclipse...).
I can't format my Java classes using Eclipse Code Formatter.
IntelliJ shows me this message :

<my_class>.java failed to format with Eclipse Code Formatter. Use a project specific or custom formatter profile in Eclipse! Loaded only 32 properties from: <my_epf_file>, should be 100+.

And this is the same problem with a file from a "classic" Eclipse.

My IntelliJ version :
IntelliJ IDEA 2020.1.2 (Ultimate Edition)
Build #IU-201.7846.76, built on June 1, 2020

My Eclipse Formatter version :
20.2.201.6668.0-Eclipse_2020-06-JavaOnly

My EPF file (in ".TXT") :
preferences_STS.epf.txt

In a previous configuration (IntelliJ and/or Eclipse Code Formatter...), it was working....

Could you help me, please ?

Thanx.

@krasa
Copy link
Owner

krasa commented Jul 6, 2020

Yes, I added a validation, because it is possible to produce config files without an actual configuration, like yours.

Actually, I need to make it even more precise and a better error message, because yours have no /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter at all (so that the formatter works with some default configuration - if you want that, then just choose one of the build-in options).

It should look like this: https://github.com/OpenGamma/Strata/blob/master/eclipse/install/Strata-Eclipse-Preferences.epf
How it is produced I do not know.

krasa added a commit that referenced this issue Jul 6, 2020
@Great-Fred
Copy link
Author

OK, I understand.

But, in Eclipse/STS4, I chose "export All" in the wizard.
So, how can I do better (and not write the file manually, if possible ^^ :-D ) ?

And I thought your plugin was looking in an Eclipse default configuration if something was missing.

However, thank you very much for your work :-).

@Great-Fred
Copy link
Author

Great-Fred commented Jul 6, 2020

OK.
Thank you.

But, I will find another way.
This "plugin" seems to be no longer available...
(I mean, the plugin you proposed to me ^^''...)

@notjustacoder
Copy link

notjustacoder commented Mar 5, 2021

I seem to be getting the same error while trying to format the code after importing a formatter XML.

"failed to format with Eclipse Code Formatter. Use a project specific or custom formatter profile in Eclipse! Loaded only 86 properties from: \path-to-file\codeformatting.xml, should be 100+."

I noticed that my XML has 86 properties ( elements). Why is that a problem though?

Update ->
Added the zipped XML.
codeformatting.zip

@krasa
Copy link
Owner

krasa commented Mar 5, 2021

post the xml

@notjustacoder
Copy link

I noticed something I didn't earlier. My previously uploaded formatter XML was generated by checkstyle (converting checkstyle rules into eclipse formatter xml), I had imported the same into the eclipse (code style -> formatter). But when I export the same again, it now has 100+ properties, which then doesn't fail validateConfig method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants