Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Eclipse automatically adding final keyword...  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Bartender
Posts: 20360
112
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rickard Engstrom
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Bartender
Posts: 20360
112
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!