This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse automatically adding final keyword... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse automatically adding final keyword..." Watch "Eclipse automatically adding final keyword..." New topic
Author

Eclipse automatically adding final keyword...

Rickard Engstrom
Greenhorn

Joined: Aug 16, 2010
Posts: 5
Hi
Simple question: How do I turn off Eclipse behaviour that automatically adds the final modifier to all local and parameter members?
It's driving me crazy, since in the following example I have a constructor with one parameter:
.
.
.

.
.
.

I don't need that final modifier insíde the constructor header. And besides, it's giving me a compiler error "The blank final field btpApp may not have been initialized"

Thanks in advance

/R
Rickard Engstrom
Greenhorn

Joined: Aug 16, 2010
Posts: 5
Rickard Engstrom wrote:Hi
Simple question: How do I turn off Eclipse behaviour that automatically adds the final modifier to all local and parameter members?
It's driving me crazy, since in the following example I have a constructor with one parameter:
.
.
.

.
.
.

I don't need that final modifier insíde the constructor header. And besides, it's giving me a compiler error "The blank final field btpApp may not have been initialized"

Thanks in advance

/R




Found it...
Windows -> Preferences -> Java -> Editor -> Save Actions
And I think I also have to mention that it actually occured upon saving a file in Eclipse!
/R
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

I would pay more attention to the message "The blank final field btpApp may not have been initialized". It's trying to tell you something important. Rename the parameter btpApp (but NOT the field btpApp) to something else while keeping the "final" attributes and see.


Customer surveys are for companies who didn't pay proper attention to begin with.
Rickard Engstrom
Greenhorn

Joined: Aug 16, 2010
Posts: 5
Tim Holloway wrote:I would pay more attention to the message "The blank final field btpApp may not have been initialized". It's trying to tell you something important. Rename the parameter btpApp (but NOT the field btpApp) to something else while keeping the "final" attributes and see.


Thanks for the reply, and in fact I noticed that the cause was not the constructor parameter but instead a class member.

Cheers

/R
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

Rickard Engstrom wrote:
Tim Holloway wrote:I would pay more attention to the message "The blank final field btpApp may not have been initialized". It's trying to tell you something important. Rename the parameter btpApp (but NOT the field btpApp) to something else while keeping the "final" attributes and see.


Thanks for the reply, and in fact I noticed that the cause was not the constructor parameter but instead a class member.

Cheers

/R
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse automatically adding final keyword...
 
Similar Threads
mock
java.lang.Math is immutable?
Final Variables
switch statement
Jtips Quiz4 No.1: About default constructor