/
Additional settings for Eclipse

Additional settings for Eclipse

Show unnecessary declaration of thrown exceptions

Many changes by different developers could lead to parts of code that are not used any more. Eclipse provides some configurations to display an error if code is unnecessary.

Go to Window → Preferences → Java → Compiler → Errors/Warnings → Unnecessary code

Go to "Unnecessary declaration of thrown exception" and select "Error".

Make sure none of the checkboxes below are selected.

 

Encoding

We do use UTF-8 encoding for all files with Unix line delimiter. 

You can change the encoding for the entire workspace in Window → Preferences → General → Workspace (see screenshot)

 

Coffee-bytes

This plugin could be used for folding regions defined in the code (like it could be done with IntelliJ).

The Look and Feel of the plugin is not the best, but right now we couldn’t find an alternative plugin which does the same nor is such a folding available in the eclipse ecosystem.

A description how to install could be found here.

Basically, the archive file has to be downloaded and extracted and then you have to copy the content of the plugin and feature folder into your eclipse installation (sorry, plugin is not available in the marketplace). After the restart, you should be able to configure the plugin in the preferences like in the following screenshots.

First, you have to select the "Coffee Bytes Java folding" and enable folding in general. Then set your folding preferences for the different types. The last one is for the custom foldings.

In the user defined Regions Tab you have to define the two tags region and endregion.

The result of using the plugin and the configuration looks like this. The upper region is folded, the lower is unfolded.

If you hover your mouse over the red dot, the region will be unfolded in an overlay like this.

(Yes, the red dot are ugly, but the plugin was developed for eclipse indigo a "few" years ago and is still working)

 

Method arrangement

Since some guidelines can not be enforced through CheckStyle or other mechanics we have to keep an eye on them during review

In contrast to Intellij, Eclipse does not keep method arrangement.

 

By visibility means the following order:

public

protected

package private

private