[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-149) Default FieldBridge for enums passing wrong class to EnumBridge constructor

Marcio Silva (JIRA) noreply at atlassian.com
Tue Jan 15 08:07:56 EST 2008


Default FieldBridge for enums passing wrong class to EnumBridge constructor
---------------------------------------------------------------------------

                 Key: HSEARCH-149
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-149
             Project: Hibernate Search
          Issue Type: Bug
          Components: mapping
    Affects Versions: 3.0.0.GA
            Reporter: Marcio Silva


Default FieldBridge for enums introduced in HSEARCH-2 added the following block to BridgeFactory:

119	+	                        if ( bridge == null && returnType.isEnum() ) {
120	+	                                bridge = new TwoWayString2FieldBridgeAdaptor(
121	+	                                                new EnumBridge( (Class<? extends Enum>) returnType.getClass() )
122	+	                                );
123	+	                        }

This results in errors unmarshalling as the class passed to the EnumBridge constructor will be the XClass implementation class for the returnType variable.

The code probably needs to load the class by name from returnType, or cast returnType to a JavaXClass to utilize the toClass() method instead of getClass()


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list