Community
Participate
Working Groups
Build Identifier: The converter method of the custom CDOType get a ClassCastException, if you have defined your own datatype, and in your model you have a List of of values from this type. While exporting data from CDO, it trys to convert data back to emf. The method gets the EDataType and as value a CDOListImpl. The CDOList could not be casted to String. Reproducible: Always Steps to Reproduce: 1. Define your own datatype (I get it with a dataytype from instance type BigDecimal) 2. Define in a model class a attribute with upper Bound > 1 3. Take a model instance into the CDO-Store 4. Try Export the data
Attached Patch should fix the problem if the custom values are in a CDOList.
Created attachment 174433 [details] fix it, if values are in list
Comment on attachment 174433 [details] fix it, if values are in list Heiko, please confirm that: 1) The number of lines that you changed is smaller than 250. 2) You are the only author of these changed lines. 3) You apply the EPL to these changed lines.
I added test case org.eclipse.emf.cdo.tests.AttributeTest.testManyValuedCustomDataType_Bugzilla_319950() and it does not fail. Heiko, please look at it and try to explain why it does not fail. Or better, provide a test case that reproduces your exact problem, then reopen this bug.
Problem is not reproducible.
Comment on attachment 174433 [details] fix it, if values are in list CDOType is not concerned with the many-valued aspect of features. I think if a list arrives in a CDOType method this should be fixed elsewhere. I'm also not sure if replacing a CDOListImpl with a BasicEList is a good idea.
Created attachment 174546 [details] Modified Attriubute test Hi Eike, I have seen your Test and hav it modified so the he reproduced the error. I found this error, when I tried to use the org.eclipse.emf.cdo.internal.ui.actions.ExportResourceAction From there I also copied the function to reproduce. In the first patch I use the BasicEList, because it should export to a file. Where are the point to reopen the bug?
These two lines are able to show the problem: EList<EObject> contents = resource.getContents(); EcoreUtil.copyAll(contents);
Created attachment 175196 [details] Test v3
Created attachment 175197 [details] Test+Fix - for future reference The problem was in CDOStore.isSet() where the many-valued feature was accessed with get(feature, NO_INDEX). NO_INDEX must only be used with single-valued features.
Committed to HEAD
Heiko, please confirm that: 1) The number of lines that you changed is smaller than 250. 2) You are the only author of these changed lines. 3) You apply the EPL to these changed lines. Otherwise we get into trouble with the legal department ;-(
I confirm that: 1) The number of lines that I changed is smaller than 250. 2) I'm the only author of these changed lines. 3) I apply the EPL to these changed lines.
Comment on attachment 174546 [details] Modified Attriubute test Thx ;-)
Available in R20110608-1407