-
Notifications
You must be signed in to change notification settings - Fork 867
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
Fix warnings #596
Fix warnings #596
Conversation
Thanks for working on improving the codebase! It looks like this PR mainly adds SerialVersionUIDs where they're missing. However, for backward compatibility and general goodness, I think we should follow the existing pattern in the codebase of including the generated UID (as generated by "serialver" or your IDE) rather than setting them all to 1. Also it looks like the Checkstyle checks fail in the Jenkins build. You can check these yourself by running "./gradlew check". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks basically fine, although I see some public methods removed from "NativeError". I'd prefer if this change stuck to formatting and serialVersionUID stuff, and furthermore I'm not sure why we'd want to remove those.
Also, I see a lot of test failures in Jenkins... does running "./gradlew check" work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is making progress and thanks for sticking with it! However if we're going to change serialVersionUIDs we have to be very careful not to break backward compatibility, in the event that someone is relying on this stuff.
So... if a class has no serial version at all, then it makes sense to add one, and adding it by running "serialver" as you did is the correct way because it sets it to the current value that Java will generate automatically.
However, if a class already has one, even if it is 1, then changing that will break compatibility for serialized objects.
So in order to guarantee that nothing breaks, then this change should add serialVersionUID using serialver if they don't exist at all, which is what you have done. However, it should not change any existing ones even if they are set to 1.
Thanks!
src/org/mozilla/javascript/commonjs/module/provider/StrongCachingModuleScriptProvider.java
Outdated
Show resolved
Hide resolved
src/org/mozilla/javascript/commonjs/module/provider/UrlModuleSourceProvider.java
Outdated
Show resolved
Hide resolved
src/org/mozilla/javascript/commonjs/module/provider/UrlModuleSourceProvider.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost! But I count three more "-1s" that we still should not remove.
Now that looks right. Thanks! |
No description provided.