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 182787 Details for
Bug 329663
[type hierarchy] Interfaces duplicated in type hierarchy on two packages from multiple projects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposted patch with test
bug_329663.txt (text/plain), 4.10 KB, created by
Jay Arthanareeswaran
on 2010-11-10 03:16:46 EST
(
hide
)
Description:
Proposted patch with test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2010-11-10 03:16:46 EST
Size:
4.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java,v >retrieving revision 1.110 >diff -u -r1.110 TypeHierarchy.java >--- model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java 6 Jul 2010 08:42:07 -0000 1.110 >+++ model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java 10 Nov 2010 07:45:37 -0000 >@@ -197,6 +197,7 @@ > * Adds the type to the collection of interfaces. > */ > protected void addInterface(IType type) { >+ if (this.interfaces.contains(type)) return; > this.interfaces.add(type); > } > /** >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java,v >retrieving revision 1.97 >diff -u -r1.97 TypeHierarchyTests.java >--- src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 11 May 2010 18:58:15 -0000 1.97 >+++ src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 10 Nov 2010 07:45:40 -0000 >@@ -35,7 +35,7 @@ > ITypeHierarchy typeHierarchy; > > static { >-// TESTS_NAMES= new String[] { "testGeneric7" }; >+// TESTS_NAMES= new String[] { "testBug329663a" }; > } > public static Test suite() { > return buildModelTestSuite(TypeHierarchyTests.class); >@@ -2421,4 +2421,84 @@ > " <anonymous #1> [in testIt() [in BugTest2Buggy [in BugTest2Buggy.java [in p288698 [in src288698.classbug [in TypeHierarchy]]]]]]\n", > hierarchy); > } >+public void testBug329663() throws JavaModelException, CoreException { >+ try { >+ IJavaProject p1 = createJavaProject("P1", new String[] {""}, new String[] {"JCL_LIB"}, new String[0], ""); >+ IJavaProject p2 = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P1"}, ""); >+ createFolder("/P1/p"); >+ createFile( >+ "/P1/p/I.java", >+ "package p;\n" + >+ "public interface I{}"); >+ createFile( >+ "/P1/p/X.java", >+ "package p;\n" + >+ "public class X implements I{\n" + >+ "}" >+ ); >+ createFolder("/P2/q"); >+ createFile( >+ "/P2/q/Y.java", >+ "package q;\n" + >+ "import p.*;\n" + >+ "public class Y implements I {\n" + >+ "}" >+ ); >+ IRegion region = JavaCore.newRegion(); >+ region.add(p1); >+ region.add(p2); >+ ITypeHierarchy hierarchy = JavaCore.newTypeHierarchy(region, null, null); >+ IType[] types = hierarchy.getRootInterfaces(); >+ assertTypesEqual("Unexpected super interfaces", >+ "java.io.Serializable\n" + >+ "p.I\n", >+ types); >+ } >+ finally{ >+ deleteProject("P1"); >+ deleteProject("P2"); >+ } >+} >+public void testBug329663a() throws JavaModelException, CoreException { >+ try { >+ IJavaProject p1 = createJavaProject("P1", new String[] {""}, new String[] {"JCL_LIB"}, new String[0], ""); >+ IJavaProject p2 = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P1"}, ""); >+ createFolder("/P1/p"); >+ createFile( >+ "/P1/p/I.java", >+ "package p;\n" + >+ "public interface I{}"); >+ createFile( >+ "/P1/p/X.java", >+ "package p;\n" + >+ "public class X implements I{\n" + >+ "}" >+ ); >+ createFolder("/P2/q"); >+ createFile( >+ "/P2/q/I.java", >+ "package q;\n" + >+ "public interface I{}"); >+ createFile( >+ "/P2/q/Y.java", >+ "package q;\n" + >+ "public class Y implements I {\n" + >+ "}" >+ ); >+ IRegion region = JavaCore.newRegion(); >+ region.add(p1); >+ region.add(p2); >+ ITypeHierarchy hierarchy = JavaCore.newTypeHierarchy(region, null, null); >+ IType[] types = hierarchy.getRootInterfaces(); >+ assertTypesEqual("Unexpected super interfaces", >+ "java.io.Serializable\n" + >+ "p.I\n" + >+ "q.I\n", >+ types); >+ } >+ finally{ >+ deleteProject("P1"); >+ deleteProject("P2"); >+ } > } >+} >\ No newline at end of file
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 329663
:
182599
|
182687
|
182787
|
183646