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

No Type Safety with 'Object' #11982

Open
IanBeer125 opened this issue Oct 10, 2022 · 0 comments
Open

No Type Safety with 'Object' #11982

IanBeer125 opened this issue Oct 10, 2022 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement

Comments

@IanBeer125
Copy link

Use Generics in the interface to set the type of the parameters rather than using the Object class.
Currently for PermissionEvaluator method
boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission)

Would or should become

interface PermissionEvaluator <S, TDO, P>
boolean hasPermission(Authentication authentication, S targetId , String targetType, P permission);
boolean hasPermission(Authentication authentication, TDO targetDomainObject, P permission);

This alleviates the need for casting and type un safety, by setting and knowing the types of data ahead of time.

@IanBeer125 IanBeer125 added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant