Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add a codeAction to generate the serialVersionUID field #153

Closed
baobaoit opened this issue Sep 28, 2021 · 6 comments
Closed

Comments

@baobaoit
Copy link

Problem Statement

Which class implements the Serializable, we need to put a field: private static final long serialVersionUID = X;.
Where X is a number type long be generated by the tool serialver of Java.

Ideas or possible solutions

Reference: Java – How to generate serialVersionUID

@mfussenegger
Copy link
Owner

This would need to be added to https://github.com/eclipse/eclipse.jdt.ls first. Could you create an issue there?

@baobaoit
Copy link
Author

I had raised the issue eclipse-jdtls/eclipse.jdt.ls#1892.
Thank you for replied and your work really awesome.

@baobaoit
Copy link
Author

Hi @mfussenegger, I had followed the instruction at eclipse-jdtls/eclipse.jdt.ls#1892 (comment) and it worked.

image

But I have a question that can we handle this with this plugin because I don't want to add that line every time to every project. Would you like to add this line to the global setting?

Thank you.

@baobaoit
Copy link
Author

baobaoit commented Oct 1, 2021

Resolved in this comment ➡️ eclipse-jdtls/eclipse.jdt.ls#1892 (comment)

@baobaoit baobaoit closed this as completed Oct 1, 2021
@abenz1267
Copy link

This seemed to work for me, however: the code-action doesn't seem to work, when the class extends another class implementing Serializable. The warning will show up, same as the code action, but nothing will be generated.

@mfussenegger
Copy link
Owner

This seemed to work for me, however: the code-action doesn't seem to work, when the class extends another class implementing Serializable. The warning will show up, same as the code action, but nothing will be generated.

If it works for a simpler case it is likely a eclipse.jdt.ls bug and you'd need to open an issue there in order for it to get fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants