Brett Meyer commented on Improvement HHH-7803

Hardy Ferentschik and I discussed a few issues on IRC today:

Regarding ReflectHelper#getFieldTypes

(11:53:47 AM) hardy__: 1. you are only inspecting declared fields, but you really would also need to check getters
(11:54:34 AM) hardy__: 2. Also your handling of the TypeVariable is wrong (just no code which runs into it)
(11:55:22 AM) hardy__: 3. You don't handle ParameterizedType at all, which is the primary failure for EmbeddedGenericsTest
(11:57:04 AM) hardy__: in terms of TypeVariable and ParameterizedType, we really need to fully resolve the type using classmate
(11:57:17 AM) hardy__: see AnnotationBindingContextImpl in this context
(11:58:19 AM) hardy__: the TypeResolver in AnnotationBindingContextImpl is really a singleton and could be moved into some until class (for example ReflectHelper)

Hardy added something like the following to handle the ParameterizedType, but it may not be complete:

if ( type instanceof ParameterizedType ) {
    fieldTypes.add( (Class<?>) ( (ParameterizedType) type ).getRawType() );
}

This goes back to the original question. Do we want to leave this auto-discovery code in, or rip it out (enforcing that @Embeddables be explicitly listed in the annotated classes)? I'd argue that Steve Ebersole's point may be the best solution: fix the implementation, but disable it by default, hiding it behind a new setting(s).

For now, it's fairly low-hanging fruit. We might want to just disable it now and update all unit tests to correctly list all annotated classes.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira