Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Clean Up option "Add missing serial version ID (generated)" always has exceptions(Automatic generation of serialVersionUID fails with exceptions)
Clean Up option "Add missing serial version ID (generated)" always has exceptions [message #1850852] Fri, 18 March 2022 15:02 Go to next message
Todd Heidenthal is currently offline Todd HeidenthalFriend
Messages: 2
Registered: March 2022
Junior Member
Whenever I apply the Clean Up item of "Add missing serial version ID (generated)" to a folder, it generates exceptions and doesn't modify the Java files.

Regardless of the level of the folder or package I select, the process selects the highest level folder in the project tree, other than the project itself, so selecting java or src or even com doesn't help.

As such it scans files of all types, including .xml and .html. It is these file types that are always throwing exceptions like:

"Could not write to read-only file: '/development_Java8/VTdesign/src/main/java/com/gtisoft/camdesign/camdata.xml'."

I know there are classes missing their serialVersionUID, but nothing shows up in my Perforce change list as being modified. I am guessing that the exceptions prevent normal completion.

I haven't used Eclipse for many years, so I expect that I am doing something wrong. I don't see any way to configure the generation of serialVersionUID to skip file types.

Any help is appreciated.

=====> Update
When I select a java file directly which I know is missing a serialVersionUID, nothing happens, no exception, no modification of the file. Does it only work in particular perspectives or views?

[Updated on: Fri, 18 March 2022 16:33]

Report message to a moderator

Re: Clean Up option "Add missing serial version ID (generated)" always has exceptions [message #1850863 is a reply to message #1850852] Fri, 18 March 2022 23:26 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Well, I imagine there's some error checking that is missing, but it would be error checking for you doing something unexpected, which is putting non-java files in src/main/java. However, I also wonder why any file in src/main/java would be read-only. I suggest you move any non-java files out of the src/main/java tree, perhaps into src/main/resources.
Re: Clean Up option "Add missing serial version ID (generated)" always has exceptions [message #1850896 is a reply to message #1850863] Mon, 21 March 2022 13:53 Go to previous message
Todd Heidenthal is currently offline Todd HeidenthalFriend
Messages: 2
Registered: March 2022
Junior Member
I expected that the clean-up inspections were smart enough not to look at files of the wrong type/extension, that was why I was surprised. I can address the read-only issue.

I did manage to get farther with inspections by adding a Java nature to my project. As I said it has been years since I used Eclipse. Getting this project to compile properly with all the interacting dependencies has proved quite the challenge. It just works in IDEA. Even exporting to Eclipse from IDEA doesn't help.

It is a gradle project, so theoretically, that should have helped, but it doesn't seem to have.

Wish me luck!
Previous Topic:Disable Autocomplete Selection on Space
Next Topic:Automatic completion is not perfect
Goto Forum:
  


Current Time: Tue Apr 23 06:13:50 GMT 2024

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

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

Back to the top