-
Notifications
You must be signed in to change notification settings - Fork 6k
Make AuthorizationProxyFactory.proxy generic #16996
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?
Make AuthorizationProxyFactory.proxy generic #16996
Conversation
Signed-off-by: dae won <[email protected]>
…ignature Signed-off-by: dae won <[email protected]>
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.
Thanks, @big-cir! I've left some feedback inline.
@@ -335,7 +335,7 @@ public void setTargetVisitorThenUses() { | |||
@Test | |||
public void setTargetVisitorIgnoreValueTypesThenIgnores() { | |||
AuthorizationAdvisorProxyFactory factory = AuthorizationAdvisorProxyFactory.withDefaults(); | |||
assertThatExceptionOfType(ClassCastException.class).isThrownBy(() -> ((Integer) factory.proxy(35)).intValue()); | |||
assertThatExceptionOfType(ClassCastException.class).isThrownBy(() -> (factory.proxy(35)).intValue()); |
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.
It looks like the parentheses are no longer needed around factory.proxy(35)
. Can you remove them please?
@@ -20,6 +20,7 @@ | |||
* A factory for wrapping arbitrary objects in authorization-related advice | |||
* | |||
* @author Josh Cummings | |||
* @author daewon kim |
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.
Will you please update the copyright year in this file and any other file you modify to 2025
?
Signed-off-by: dae won <[email protected]>
70bab2b
to
7b8ba13
Compare
Overview
This pull request updates the AuthorizationProxyFactory interface to make its proxy method generic, ensuring that it returns the same type as the input object.
The following changes are included:
Related
ISSUE: #16706
Note
I’m aware that the issue is currently labeled with status: waiting-for-triage, which indicates that the final design direction may not be settled yet. This PR reflects my current understanding of the issue and is intended as a starting point for further discussion.
If this approach does not align with the intended direction, please feel free to close the PR or provide feedback. I am happy to revise or take a different direction as needed. Thank you!