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 151587 Details for
Bug 288464
[navigation] Open Implementation hyperlink does not show multiple implementations
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]
Updated Patch
patch3_288464.txt (text/plain), 4.64 KB, created by
Raksha Vasisht
on 2009-11-06 12:31:38 EST
(
hide
)
Description:
Updated Patch
Filename:
MIME Type:
Creator:
Raksha Vasisht
Created:
2009-11-06 12:31:38 EST
Size:
4.64 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementImplementationHyperlink.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementImplementationHyperlink.java,v >retrieving revision 1.9 >diff -u -r1.9 JavaElementImplementationHyperlink.java >--- ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementImplementationHyperlink.java 5 Aug 2009 07:19:30 -0000 1.9 >+++ ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementImplementationHyperlink.java 6 Nov 2009 14:16:45 -0000 >@@ -12,6 +12,7 @@ > > import java.lang.reflect.InvocationTargetException; > import java.util.ArrayList; >+import java.util.List; > > import org.eclipse.core.runtime.Assert; > import org.eclipse.core.runtime.CoreException; >@@ -39,7 +40,9 @@ > import org.eclipse.jdt.core.IJavaElement; > import org.eclipse.jdt.core.IMethod; > import org.eclipse.jdt.core.IType; >+import org.eclipse.jdt.core.ITypeHierarchy; > import org.eclipse.jdt.core.ITypeRoot; >+import org.eclipse.jdt.core.JavaModelException; > import org.eclipse.jdt.core.dom.ASTNode; > import org.eclipse.jdt.core.dom.CompilationUnit; > import org.eclipse.jdt.core.dom.Expression; >@@ -59,6 +62,7 @@ > import org.eclipse.jdt.internal.corext.dom.Bindings; > import org.eclipse.jdt.internal.corext.util.JdtFlags; > import org.eclipse.jdt.internal.corext.util.Messages; >+import org.eclipse.jdt.internal.corext.util.MethodOverrideTester; > > import org.eclipse.jdt.ui.JavaElementLabels; > import org.eclipse.jdt.ui.SharedASTProvider; >@@ -200,7 +204,17 @@ > } > try { > String methodLabel= JavaElementLabels.getElementLabel(javaElement, JavaElementLabels.DEFAULT_QUALIFIED); >- monitor.beginTask(Messages.format(JavaEditorMessages.JavaElementImplementationHyperlink_search_method_implementors, methodLabel), 100); >+ monitor.beginTask(Messages.format(JavaEditorMessages.JavaElementImplementationHyperlink_search_method_implementors, methodLabel), 10); >+ ITypeHierarchy superTypeHierarchy= type.newSupertypeHierarchy(new SubProgressMonitor(monitor, 3)); >+ IType[] rootInterfaces= superTypeHierarchy.getRootInterfaces(); >+ IType superType; >+ if (rootInterfaces.length == 0) { >+ superType= type; >+ } else { >+ superType= getDeclaringType(superTypeHierarchy, rootInterfaces); >+ if (superType == null) >+ return; >+ } > SearchRequestor requestor= new SearchRequestor() { > public void acceptSearchMatch(SearchMatch match) throws CoreException { > if (match.getAccuracy() == SearchMatch.A_ACCURATE) { >@@ -219,7 +233,7 @@ > Assert.isNotNull(pattern); > SearchParticipant[] participants= new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }; > SearchEngine engine= new SearchEngine(); >- engine.search(pattern, participants, SearchEngine.createHierarchyScope(type), requestor, new SubProgressMonitor(monitor, 100)); >+ engine.search(pattern, participants, SearchEngine.createHierarchyScope(superType), requestor, new SubProgressMonitor(monitor, 7)); > > if (monitor.isCanceled()) { > throw new OperationCanceledException(); >@@ -230,6 +244,34 @@ > monitor.done(); > } > } >+ >+ /** >+ * Get the declaring type for the given method. >+ * >+ * @param superTypeHierarchy the super type hierarchy >+ * @param rootInterfaces the array of super interfaces >+ * @return the super interface if the method is declared only in one of the given super >+ * interfaces, the declaring type itself if the method is not declared in any >+ * super interface, null otherwise >+ * @throws JavaModelException if the java element does not exist or if an exception >+ * occurs while accessing its corresponding resource >+ */ >+ public IType getDeclaringType(ITypeHierarchy superTypeHierarchy, IType[] rootInterfaces) throws JavaModelException { >+ List typesContainingMethod= new ArrayList(rootInterfaces.length); >+ MethodOverrideTester methodOverrideTester= new MethodOverrideTester(type, superTypeHierarchy); >+ for (int i= 0; i < rootInterfaces.length; i++) { >+ IMethod[] methods= rootInterfaces[i].getMethods(); >+ for (int j= 0; j < methods.length; j++) { >+ if (methodOverrideTester.isSubsignature(methods[j], (IMethod)javaElement)) { >+ typesContainingMethod.add(rootInterfaces[i]); >+ break; >+ } >+ } >+ if (typesContainingMethod.size() > 1) >+ return null; >+ } >+ return (IType)(typesContainingMethod.size() == 1 ? typesContainingMethod.get(0) : type); >+ } > }; > > try {
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
Flags:
daniel_megert
:
review-
Actions:
View
|
Diff
Attachments on
bug 288464
:
149619
|
150467
|
151587
|
152156
|
152163
|
152464
|
152469
|
152565