Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » problem with Java -> Editor -> Save Actions(Adding final modifier to java.lang.Record is a no no !!)
problem with Java -> Editor -> Save Actions [message #1839222] Wed, 17 March 2021 18:43 Go to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 139
Registered: October 2018
Senior Member
We have java 16, so I tried using java.lang. Record .

I have "use modifier 'final' were possible" rule.

index.php/fa/40148/0/

Eclipse add 'final' modifier to the component names.

index.php/fa/40149/0/

We have syntax error "A record component name cannot have modifiers"

I think that Eclipse recognize the component names as regular "Java constructor" which is not the case.

Has anyone had the same problem ?

Regards.

[Updated on: Wed, 17 March 2021 18:45]

Report message to a moderator

Re: problem with Java -> Editor -> Save Actions [message #1839232 is a reply to message #1839222] Thu, 18 March 2021 03:51 Go to previous messageGo to next message
Manoj N Palat is currently offline Manoj N PalatFriend
Messages: 19
Registered: October 2014
Junior Member
Hi Eitan,
thanks for trying out the Java 16 support in Eclipse.

It is indeed an error to have a final modifier in record components [ref: https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-8.10.1].
I have created a bug for the same.
@Eitan: Can you please add these details in the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=572052 - Bug 572052 - [16] [save action] Final modifier added incorrectly to record

Thanks,
Manoj


Manoj N Palat
Eclipse Java Development Tools (JDT).
Re: problem with Java -> Editor -> Save Actions [message #1839237 is a reply to message #1839232] Thu, 18 March 2021 06:14 Go to previous message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 139
Registered: October 2018
Senior Member
Hi Manoj,

I will add the required details to 572052.

Thanks for the bug creation.

Regards.
Eitan.
Previous Topic:How to git rid of indentation help guide while writing a code
Next Topic:Java Compliance Level keeps reseting to 1.8 after restart
Goto Forum:
  


Current Time: Tue Apr 23 13:09:07 GMT 2024

Powered by FUDForum. Page generated in 0.03028 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top