You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the converter property for the @convert annotation is declared as follows:
Class converter() default void.class;
However, along with just generally being unsafe ("safe" use would be Class<?>), this does not properly restrict the set of classes that can be specified. My understanding is that this MUST be a class that implements javax.persistence.AttributeConverter. Therefore, the converter property should be specified like so:
With this change, the developer will know at compile time if he has specified an incorrect class. Without this change, the developer will not know until he gets a runtime error, which is seriously less desirable.
The text was updated successfully, but these errors were encountered:
@glassfishrobot Commented
neilstockton said:
You can't do that.
Class<? extends AttributeConverter> converter() default void.class;
would not compile. "void.class" is not castable to the generic form (but is to the non-generic form, hence probably why they did it).
Currently, the converter property for the @convert annotation is declared as follows:
However, along with just generally being unsafe ("safe" use would be Class<?>), this does not properly restrict the set of classes that can be specified. My understanding is that this MUST be a class that implements javax.persistence.AttributeConverter. Therefore, the converter property should be specified like so:
With this change, the developer will know at compile time if he has specified an incorrect class. Without this change, the developer will not know until he gets a runtime error, which is seriously less desirable.
The text was updated successfully, but these errors were encountered: