- edited description
Update Yaml.LoadAs() signature to support Class<? super T> type instead of Class<T>
The issue I’m having with the current method signature is that it throws a compiler warning when passing an unparameterized class of type T. Parameterizing Class<T> is not possible without this new signature. Passing as unparameterized yields a raw type, which otherwise works fine, but is throwing a warning. Instead of suppressing it, I would rather resolve it at the public interface where the cast is already unchecked, but with the option to support parameterized types.
snakeyaml / snakeyaml / src / main / java / org / yaml / snakeyaml / Yaml.java — Bitbucket
<T> T loadAs(String yaml, Class<T> type)
would become public
<T> T loadAs(String yaml, Class<? super T> type)
etc.
Comments (8)
-
reporter -
reporter - edited description
-
-
assigned issue to
-
assigned issue to
-
- changed status to open
-
-
reporter Looks great. Thank you.
-
Unfortunately, the change is not backwards compatible (you can see it in the test). It changes the scope.
-
- changed status to resolved
it will be delivered in version 1.34
- Log in to comment