Discussion:
[castor-dev] Refactoring of FieldMappingCollectionType breaks backward compability
Mattias Bogeblad
2014-10-01 06:04:35 UTC
Permalink
Hi all,

I hope this is allright to post here. Between 1.3.1 and 1.3.3 of castor the class org.exolab.castor.mapping.xml.types.FieldMappingCollectionType seems to have changed a bit.

In my case - the class org.exolab.castor.xml.XMLMappingLoader.createFieldDesc (around line 620) the code starts mapping a collection type. In my case a files typeName derived on 626 is "collection". But then colType is looked for by using

colType = FieldMappingCollectionType.valueOf(typeName); //(typeName = "collection" in my case).

This returns an error about that there is no such entry in the enumeration. If the line on the other hand would use

colType = FieldMappingCollectionType.fromValue(typeName);

it works. Now I'm not sure if both cases could be true or if it's just a mistake in the refactoring of the enum. Right now I have just made a silly patch which tries both in case one of them works. But I would like this to be solved in the official branch naturally.

Regards
Mattias Bogeblad


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Werner Guttmann
2014-10-03 19:15:54 UTC
Permalink
Hi Mattias,

can you please create a Jira issue and attach your patch for review ?

Thanks
Werner
Post by Mattias Bogeblad
Hi all,
I hope this is allright to post here. Between 1.3.1 and 1.3.3 of castor the class org.exolab.castor.mapping.xml.types.FieldMappingCollectionType seems to have changed a bit.
In my case - the class org.exolab.castor.xml.XMLMappingLoader.createFieldDesc (around line 620) the code starts mapping a collection type. In my case a files typeName derived on 626 is "collection". But then colType is looked for by using
colType = FieldMappingCollectionType.valueOf(typeName); //(typeName = "collection" in my case).
This returns an error about that there is no such entry in the enumeration. If the line on the other hand would use
colType = FieldMappingCollectionType.fromValue(typeName);
it works. Now I'm not sure if both cases could be true or if it's just a mistake in the refactoring of the enum. Right now I have just made a silly patch which tries both in case one of them works. But I would like this to be solved in the official branch naturally.
Regards
Mattias Bogeblad
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...