Eladian
Eladian

Reputation: 958

IntelliJ IDEA, turn off insertion of 'final' keyword before instance variables on format/save (JAVA)

I cannot for the life of me find out where I can turn off insertion of the 'final' keyword on instance variables in IntelliJ IDEA.

Basically IntelliJ is checking to see if a instance field is being assigned to and if it isn't its automatically making it final. This wouldn't be a problem usually but I am doing serialization and it is presenting problems.

As a reference (I declare):

 private HashSet<Integer> removedIndex = new HashSet<>();

IntelliJ makes it:

private final HashSet<Integer> removedIndex = new HashSet<>();

Thanks for any help!

Upvotes: 0

Views: 1699

Answers (1)

glytching
glytching

Reputation: 48015

Sounds like you are using the Save Actions Plugin. To disable this behaviour ...

  • Preferences > Other Settings > Save Actions
  • Untick Add final to field

Upvotes: 1

Related Questions