Community
Participate
Working Groups
The way the featureIDs is constructed and populated is incorrect. The length of the array must be equal to the number of ALL features, not just the persistent features, and it should be Currently, if one calls CDOClassInfoImpl.getFeatureIndex with either a transient feature or its featureID as the argument, one of 2 things will happen: 1) If the transient feat is not the last feat of the EClass, no error will be detected, but 0 will be returned -- simply the default init value for every element in an int[] 2) if the transient feat is the last feature of the EClass, an ArrayIndexOutOfBoundsException will occur, which gets converted to an IllegalStateException with the message that the feature is not mapped. This is true, but the mechanism only works this way if indeed the featureID is beyond the size of the array. Patch forthcoming.
Created attachment 187829 [details] Patch (including testcase)
(In reply to comment #0) > The length of the array must be equal to > the number of ALL features, not just the persistent > features, and it should be Right... I see I left off in mid-sentence. Well, what I meant was: ... it should be initialized with some marker values so that unmapped features can be recognized. After weighing many, many options, such as -29, -11, -43, and other prime numbers, I decided that the marker value shall be.......... -1 !!! See patch, & have a good weekend.
Created attachment 187838 [details] Enables EMF notifications on transaction.rollback() Updated patch (187818). Does now only a single load revision call to the server. I confirm to 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.
(In reply to comment #2) > After weighing many, many options, such as -29, -11, > -43, Primes are over-appreciated, why not -42 ?! :P
Created attachment 187909 [details] Patch v2 - ready to be committed Just some minor changes: I introduced a symbolic constant for the marker: int NOT_MAPPED = -1 I changed the exception message: "Feature not mapped: " + getEClass().getEStructuralFeature(featureID) I changed the array initialization: Arrays.fill(featureIDMappings, NOT_MAPPED)
(In reply to comment #5) > I changed the array initialization: Arrays.fill(featureIDMappings, NOT_MAPPED) Amazing, I was wondering whether Java had something like that :-) Committed to trunk, r. 6982.
Available in R20110608-1407