Steve
Steve

Reputation: 2816

Eclipse Deletes new Private Member Variables Upon Saving A File

Eclipse 4.6.1

Anytime I add a new private member variable to a Java class, as soon as I hit save Eclipse deletes it. Eclipse will let me keep the additions if I set the new member to public.

I tried this in a few different classes, all POJOs.

Upvotes: 0

Views: 45

Answers (1)

jf_
jf_

Reputation: 3479

No idea how that got in there without you knowing, but maybe you have a save action enabled. You find that under

Preferences>>Java>>Editor>>Save Actions

Deleting unused private members is one of the options under "Configure". Just disable it by unchecking the "Additional actions" box.

Save Actions Configuration

Upvotes: 2

Related Questions