-
Notifications
You must be signed in to change notification settings - Fork 470
Fix ConstructorThrow SpotBugs warnings in core module #5785
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
base: main
Are you sure you want to change the base?
Fix ConstructorThrow SpotBugs warnings in core module #5785
Conversation
ddanielr
left a comment
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.
Moving this check out from the top-level pom to the modules makes sense.
Do we need to make release notes changes for finalizing any of the classes that are defined in our public API?
That is a good question. I am not sure. |
|
I think feedback regarding the method of fixing this warning would be helpful (making the class final vs. adding the |
I don't see an issue with finalizing the default implementation classes since users should be implementing new classes from the interface rather than extending the clientImpl classes. Since finalize() is deprecated, does this SpotBugs warning go away if we were to switch to a newer java version? |
I have no issue with making classes final where we can and where it makes sense. I'm not sure adding a finalizer to fix the others is a good long-term approach though it's likely the easiest fix. Finalizers themselves are deprecated and will be removed in a future Java release. I'm wondering if fixing the objects so that they don't throw exceptions from the constructor is the better choice, for example, using an |
ctubbsii
left a comment
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.
These are pretty broad suppressions. I think it's nice that you're trying to narrow them down and triage them one at a time, but I'm wondering if this should be considered a WIP, or is this the intended final PR?
core/src/main/java/org/apache/accumulo/core/classloader/URLContextClassLoaderFactory.java
Outdated
Show resolved
Hide resolved
|
This PR is no longer a WIP. To fix these spotbugs warnings I either made the class final (best solution, not possible everywhere) or I added a |
keith-turner
left a comment
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.
All the java changes look good, could not really review the maven changes very well though.
core/src/main/java/org/apache/accumulo/core/classloader/URLContextClassLoaderFactory.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/iteratorsImpl/conf/ColumnSet.java
Outdated
Show resolved
Hide resolved
* remove overly restrictive exception thrown from ContextClassLoaderFactory constructor * make ColumnSet final since its in an impl package * remove empty build and plugin blocks from pom (leftover from previous iteration) Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
This PR fixes the warnings from the core module. Here is a description from the ticket:
I removed omit block from the root pom and instead moved it into each module so that we can just ignore this spotbugs warning until we fix them in each module.