Skip to content

Conversation

@plan11plan
Copy link

@plan11plan plan11plan commented Apr 6, 2025

Hello!

This PR enhances inline documentation for methods using @SuppressWarnings("unchecked") to address concerns highlighted in Effective Java: Item 27 – "Eliminate unchecked warnings."

  • registerStoredProcedureParameter: Added comments explaining the unchecked conversion from raw Class to a generic type.
  • getResultList: Documented the reason behind casting Collections.EMPTY_LIST as List and casting ResultSetOutput to List.
  • unwrap: Clarified that runtime type checks (cls.isInstance()) ensure the safety of casting 'this', parameterMetadata, etc.

These changes help maintainers understand why the warnings are suppressed and prevent accidental removal or modification that might compromise type safety.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19321

@gavinking
Copy link
Member

I don't think there's much value to commenting this sort of "obvious" stuff. Much better to actually fix the typing issues and remove the @SuppressWarnings. I did some of that in #9968.

@gavinking gavinking closed this Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants