-
Notifications
You must be signed in to change notification settings - Fork 236
Method signature mismatched with javadoc and implementation #2587
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
Conversation
...torsdk/operator/api/reconciler/dependent/managed/DefaultManagedDependentResourceContext.java
Outdated
Show resolved
Hide resolved
|
This should target the |
47c32f6 to
73688b8
Compare
|
pushed up creating a new method and deprecating the old, a bit clunky since |
|
Upon further review, looking at the history of the modifications, I believe that this API got broken at some point in the past and we should probably conform to the |
|
@robobario see #2595 for the changes that I think should be included as part of this work. |
Signed-off-by: Robert Young <[email protected]>
73688b8 to
a5c1a7a
Compare
Signed-off-by: Chris Laprun <[email protected]>
Signed-off-by: Robert Young <[email protected]>
a5c1a7a to
6171ebf
Compare
|
great, thanks @metacosm . Have updated and cleaned up the git history (and renamed a test method) |
csviri
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.
LGTM
|
thank you! |
|
Thank you for your work! |
The javadoc of
ManagedDependentResourceContext#putdescribe it as returningOptional. The implementation returns anOptionalbut casts it to T, so it is currently a compile error to write:Using the method as declared results in a ClassCastException:
fails with:
The user can cast to get at the Optional like
Optional<String> actual = (Optional<String>) (Object) context.put("key", "value");So this PR updated the javadoc and implementation to match the method declaration and return the object-or-null rather than an Optional.