Message10568
So the problem is not what I thought it could be in msg10567. Define a test class like so:
// example simplified from
// org.eclipse.emf.ecore.util.DelegatingFeatureMap in the Eclipse
// Modeling Framework
// used as a test of http://bugs.jython.org/issue2445
package javatests;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.AbstractSequentialList;
import java.util.Iterator;
import java.util.ListIterator;
// The following tag interfaces duplicate the interface/abstract class supertypes of
// org.eclipse.emf.ecore.util.DelegatingFeatureMap
// NOTE this class/interface hierarchy is sort of crazy, isn't it?
interface EList<E> extends java.util.List<E> {}
interface InternalEList<E> extends EList<E> {
interface Unsettable<E> extends InternalEList<E> {}
}
abstract class AbstractSequentialInternalEList<E> extends AbstractSequentialList<E> implements InternalEList<E> {}
abstract class EContentsEList<E> extends AbstractSequentialInternalEList<E> implements EList<E>, InternalEList<E> {
interface FeatureListIterator<E> extends FeatureIterator<E>, ListIterator<E> {}
interface FeatureIterator<E> extends Iterator<E> {}
}
interface FeatureMap extends EList<FeatureMap.Entry> {
interface Entry {
interface Internal extends Entry {
}
}
interface ValueListIterator<E> extends EContentsEList.FeatureListIterator<E> {}
interface Internal extends FeatureMap, InternalEList<Entry>, EStructuralFeature.Setting {
interface Wrapper {}
}
}
abstract class AbstractEList<E> extends AbstractList<E> implements EList<E> {}
abstract class DelegatingEList<E> extends AbstractEList<E> implements Cloneable, Serializable {}
interface NotifyingList<E> extends EList<E> {}
abstract class DelegatingNotifyingListImpl<E> extends DelegatingEList<E> implements NotifyingList<E> {}
abstract class DelegatingNotifyingInternalEListImpl<E> extends DelegatingNotifyingListImpl<E> implements InternalEList<E> {}
interface Notifier {}
interface EObject extends Notifier {}
interface EModelElement extends EObject {}
interface ENamedElement extends EModelElement {}
interface ETypedElement extends ENamedElement {}
interface EStructuralFeature extends ETypedElement {
interface Setting {}
}
abstract class DelegatingEcoreEList<E> extends DelegatingNotifyingInternalEListImpl<E>
implements InternalEList.Unsettable<E>, EStructuralFeature.Setting {}
public abstract class DelegatingFeatureMapMRO extends DelegatingEcoreEList<FeatureMap.Entry>
implements FeatureMap.Internal, FeatureMap.Internal.Wrapper {}
Then
>>> from javatests import DelegatingFeatureMapMRO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Supertypes that share a modified attribute have an MRO conflict[attribute=remove, supertypes=[<type 'java.util.List'>, <type 'java.util.AbstractList'>], type=DelegatingFeatureMapMRO]
Given that java.util.AbstractList implements java.util.List, there should be no conflict.
Note that as in #1878, some inheritance complexity is required to demonstrate the bug. A simple test class like so presents no problems:
package javatests;
import java.util.AbstractList;
import java.util.List;
abstract class DiamondAbstractList extends AbstractList implements List {}
>>> from javatests import DiamondAbstractList
>>>
Presumably in between the two test classes is one of the appropriate complexity to trigger this problem. |
|
Date |
User |
Action |
Args |
2015-12-29 17:45:19 | zyasoft | set | messageid: <1451411119.91.0.810966584764.issue2445@psf.upfronthosting.co.za> |
2015-12-29 17:45:19 | zyasoft | set | recipients:
+ zyasoft, tomluk |
2015-12-29 17:45:19 | zyasoft | link | issue2445 messages |
2015-12-29 17:45:19 | zyasoft | create | |
|