Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 94297 Details for
Bug 224969
Got "The super interfaces set has been reduced" but I didn't
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed fix
patch_224969.txt (text/plain), 13.45 KB, created by
Olivier Thomann
on 2008-03-31 18:45:39 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2008-03-31 18:45:39 EDT
Size:
13.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.api.tools.tests >Index: src/org/eclipse/pde/api/tools/comparator/tests/ClassDeltaTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/ClassDeltaTests.java,v >retrieving revision 1.7 >diff -u -r1.7 ClassDeltaTests.java >--- src/org/eclipse/pde/api/tools/comparator/tests/ClassDeltaTests.java 27 Mar 2008 20:46:36 -0000 1.7 >+++ src/org/eclipse/pde/api/tools/comparator/tests/ClassDeltaTests.java 31 Mar 2008 22:44:54 -0000 >@@ -35,7 +35,9 @@ > public static Test suite() { > if (true) return new TestSuite(ClassDeltaTests.class); > TestSuite suite = new TestSuite(ClassDeltaTests.class.getName()); >- suite.addTest(new ClassDeltaTests("test114")); >+ suite.addTest(new ClassDeltaTests("test49")); >+ suite.addTest(new ClassDeltaTests("test50")); >+ suite.addTest(new ClassDeltaTests("test51")); > return suite; > } > >@@ -1130,9 +1132,14 @@ > IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); > assertNotNull("No delta", delta); > IDelta[] allLeavesDeltas = collectLeaves(delta); >- assertEquals("Wrong size", 1, allLeavesDeltas.length); >+ assertEquals("Wrong size", 2, allLeavesDeltas.length); > IDelta child = allLeavesDeltas[0]; > assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[1]; >+ assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); > assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); > assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); > assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); >@@ -1152,7 +1159,7 @@ > IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); > assertNotNull("No delta", delta); > IDelta[] allLeavesDeltas = collectLeaves(delta); >- assertEquals("Wrong size", 3, allLeavesDeltas.length); >+ assertEquals("Wrong size", 6, allLeavesDeltas.length); > IDelta child = allLeavesDeltas[0]; > assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); > assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); >@@ -1168,6 +1175,21 @@ > assertEquals("Wrong flag", IDelta.EXPANDED_SUPERCLASS_SET, child.getFlags()); > assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); > assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[3]; >+ assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[4]; >+ assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[5]; >+ assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); > } > > /** >@@ -1184,7 +1206,7 @@ > IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); > assertNotNull("No delta", delta); > IDelta[] allLeavesDeltas = collectLeaves(delta); >- assertEquals("Wrong size", 3, allLeavesDeltas.length); >+ assertEquals("Wrong size", 6, allLeavesDeltas.length); > IDelta child = allLeavesDeltas[0]; > assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); > assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERCLASS_SET, child.getFlags()); >@@ -1197,6 +1219,21 @@ > assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); > child = allLeavesDeltas[2]; > assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[3]; >+ assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[4]; >+ assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.CONTRACTED_SUPERINTERFACES_SET, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[5]; >+ assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); > assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); > assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); > assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); >@@ -2691,4 +2728,30 @@ > assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); > assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); > } >+ /** >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=224969 >+ */ >+ public void test115() { >+ deployBundles("test115"); >+ IApiProfile before = getBeforeState(); >+ IApiProfile after = getAfterState(); >+ IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME); >+ assertNotNull("no api component", beforeApiComponent); >+ IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME); >+ assertNotNull("no api component", afterApiComponent); >+ IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after); >+ assertNotNull("No delta", delta); >+ IDelta[] allLeavesDeltas = collectLeaves(delta); >+ assertEquals("Wrong size", 2, allLeavesDeltas.length); >+ IDelta child = allLeavesDeltas[0]; >+ assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.SUPERCLASS, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); >+ assertTrue("Is compatible", DeltaProcessor.isCompatible(child)); >+ child = allLeavesDeltas[1]; >+ assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); >+ assertEquals("Wrong flag", IDelta.TYPE, child.getFlags()); >+ assertEquals("Wrong element type", IDelta.API_COMPONENT_ELEMENT_TYPE, child.getElementType()); >+ assertTrue("Is compatible", DeltaProcessor.isCompatible(child)); >+ } > } >\ No newline at end of file >Index: tests-deltas/class/test115/after/I.java >=================================================================== >RCS file: tests-deltas/class/test115/after/I.java >diff -N tests-deltas/class/test115/after/I.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ tests-deltas/class/test115/after/I.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+public interface I { >+} >Index: tests-deltas/class/test115/after/X.java >=================================================================== >RCS file: tests-deltas/class/test115/after/X.java >diff -N tests-deltas/class/test115/after/X.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ tests-deltas/class/test115/after/X.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+public class X extends B { >+} >Index: tests-deltas/class/test115/after/B.java >=================================================================== >RCS file: tests-deltas/class/test115/after/B.java >diff -N tests-deltas/class/test115/after/B.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ tests-deltas/class/test115/after/B.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+public class B implements I { >+} >Index: tests-deltas/class/test115/before/I.java >=================================================================== >RCS file: tests-deltas/class/test115/before/I.java >diff -N tests-deltas/class/test115/before/I.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ tests-deltas/class/test115/before/I.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+public interface I { >+} >Index: tests-deltas/class/test115/before/X.java >=================================================================== >RCS file: tests-deltas/class/test115/before/X.java >diff -N tests-deltas/class/test115/before/X.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ tests-deltas/class/test115/before/X.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+public class X implements I { >+} >#P org.eclipse.pde.api.tools >Index: src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java,v >retrieving revision 1.12 >diff -u -r1.12 ClassFileComparator.java >--- src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java 28 Mar 2008 19:27:30 -0000 1.12 >+++ src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java 31 Mar 2008 22:44:56 -0000 >@@ -440,28 +440,51 @@ > private void collectAllInterfaces(TypeDescriptor typeDescriptor, IApiComponent apiComponent, IApiProfile profile, Set set) { > try { > Set interfaces = typeDescriptor.interfaces; >- if (interfaces == null) return; >- for (Iterator iterator = interfaces.iterator(); iterator.hasNext();) { >- String interfaceName = (String) iterator.next(); >- String packageName = Util.getPackageName(interfaceName); >+ if (interfaces != null) { >+ for (Iterator iterator = interfaces.iterator(); iterator.hasNext();) { >+ String interfaceName = (String) iterator.next(); >+ String packageName = Util.getPackageName(interfaceName); >+ IApiComponent[] components = profile.resolvePackage(apiComponent, packageName); >+ if (components == null) { >+ // TODO should we report this failure ? >+ if (DEBUG) { >+ System.err.println("SUPERINTERFACES LOOKUP: Could not find package " + packageName + " in profile " + profile.getName() + " from component " + apiComponent.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ } >+ continue; >+ } >+ IClassFile superinterface = Util.getClassFile(components, interfaceName); >+ if (superinterface == null) { >+ // TODO should we report this failure ? >+ if (DEBUG) { >+ System.err.println("SUPERINTERFACES LOOKUP: Could not find interface " + interfaceName + " in profile " + profile.getName() + " from component " + apiComponent.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ } >+ continue; >+ } >+ TypeDescriptor typeDescriptor2 = new TypeDescriptor(superinterface.getContents()); >+ set.add(typeDescriptor2); >+ collectAllInterfaces(typeDescriptor2, apiComponent, profile, set); >+ } >+ } >+ String superclassName = typeDescriptor.superName; >+ if (!Util.isJavaLangObject(superclassName)) { >+ String packageName = Util.getPackageName(superclassName); > IApiComponent[] components = profile.resolvePackage(apiComponent, packageName); > if (components == null) { > // TODO should we report this failure ? > if (DEBUG) { > System.err.println("SUPERINTERFACES LOOKUP: Could not find package " + packageName + " in profile " + profile.getName() + " from component " + apiComponent.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > } >- continue; >+ return; > } >- IClassFile superinterface = Util.getClassFile(components, interfaceName); >- if (superinterface == null) { >+ IClassFile superclass = Util.getClassFile(components, superclassName); >+ if (superclass == null) { > // TODO should we report this failure ? > if (DEBUG) { >- System.err.println("SUPERINTERFACES LOOKUP: Could not find interface " + interfaceName + " in profile " + profile.getName() + " from component " + apiComponent.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ System.err.println("SUPERINTERFACES LOOKUP: Could not find class " + superclassName + " in profile " + profile.getName() + " from component " + apiComponent.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > } >- continue; >+ return; > } >- TypeDescriptor typeDescriptor2 = new TypeDescriptor(superinterface.getContents()); >- set.add(typeDescriptor2); >+ TypeDescriptor typeDescriptor2 = new TypeDescriptor(superclass.getContents()); > collectAllInterfaces(typeDescriptor2, apiComponent, profile, set); > } > } catch (CoreException e) { >@@ -1098,8 +1121,6 @@ > } > > private Set getInterfacesSet(TypeDescriptor typeDescriptor, IApiComponent apiComponent, IApiProfile profile) { >- TypeDescriptor descriptor = typeDescriptor; >- if (descriptor.interfaces == null) return null; > HashSet set = new HashSet(); > collectAllInterfaces(typeDescriptor, apiComponent, profile, set); > return set;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 224969
: 94297