17
votes

In our company we have a strict list of Eclipse Error/Warning settings that must be used. Compiling our changes with this list, no Errors/Warnings should exist before checking in.

These Errors/Warnings can be found in Eclipse under Preferences -> Java -> Compiler -> Errors/Warnings. (Below is an example of some of the Eclipse settings, pls forgive the clipping at the bottom.)

I'm an IntelliJ user. IntelliJ has a similar concept called "Inspections". Inspection settings can be found under Settings -> Editor -> Inspections.

Does anyone know a way of migrating the Eclipse Errors/Warnings over the the closest possible match of IntelliJ inspection settings. I can see that there is a way to export/import the IntelliJ settings, but can't see any such functionality in Eclipse.

Any help would be appreciated.

PLEASE NOTE: This question is NOT about migrating "Code Style" settings between Eclipse and IntelliJ.

enter image description here

1
Eclipse: File > Export/Import...: General > Preferences, select Java Compiler Preferences. If using project specific settings, the compiler preferences are stored in the project folder in .settings/org.eclipse.jdt.core.prefs (all preferences, not only the preferences which are different from default).howlger

1 Answers

3
votes

In Eclipse the Java Compiler Preferences can exported via File > Export...: General > Preferences. Such an exported file only contains the settings that differ from the default setting.

For all Java Compiler Preferences, in a Java project in Project > Properties: Java Compiler make sure the checkbox Enable project specific settings is checked and use the project file .settings/org.eclipse.jdt.core.prefs.

I don't know if this files can be imported into IntelliJ. In my experience, there are only correspondences Inspections for simple checks. While comparing, I noticed that the (potential) null pointer access check of Eclipse finds problems that IntelliJ does not find. Surely there are also cases where Eclipse overlooks something or issues false warnings. Alternatively, you could use the Eclipse compiler that comes with IntelliJ. I haven't tried it yet, but with the -properties <file> pointing to the .settings/org.eclipse.jdt.core.prefs file, it should be possible to see the problems found by Eclipse in IntelliJ. But remember that in IntelliJ the files are not compiled on saving but before execution.