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 152156 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]
Patch with discussed changes
patch5_288464.txt (text/plain), 4.66 KB, created by
Raksha Vasisht
on 2009-11-13 08:54:21 EST
(
hide
)
Description:
Patch with discussed changes
Filename:
MIME Type:
Creator:
Raksha Vasisht
Created:
2009-11-13 08:54:21 EST
Size:
4.66 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 13 Nov 2009 13:44:29 -0000 >@@ -39,7 +39,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 +61,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; >@@ -184,8 +187,8 @@ > parentTypeBinding= Bindings.getBindingOfParentType(node); > } > } >- final IType type= parentTypeBinding != null ? (IType) parentTypeBinding.getJavaElement() : null; >- if (type == null) { >+ final IType recieverType= parentTypeBinding != null ? (IType)parentTypeBinding.getJavaElement() : null; >+ if (recieverType == null) { > openQuickHierarchy(editor); > return; > } >@@ -200,7 +203,10 @@ > } > 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= recieverType.newSupertypeHierarchy(new SubProgressMonitor(monitor, 3)); >+ IType type; >+ type= getDeclaringType(superTypeHierarchy, (IMethod)javaElement, recieverType); > SearchRequestor requestor= new SearchRequestor() { > public void acceptSearchMatch(SearchMatch match) throws CoreException { > if (match.getAccuracy() == SearchMatch.A_ACCURATE) { >@@ -219,7 +225,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(type), requestor, new SubProgressMonitor(monitor, 7)); > > if (monitor.isCanceled()) { > throw new OperationCanceledException(); >@@ -256,6 +262,32 @@ > } > > /** >+ * Return the declaring type for the given method if the method is abstract in the receiver >+ * type, else return the receiver type. >+ * <p> >+ * Note: A declaring type has the 'original' method declaration that does not override nor >+ * implement a method. >+ * </p> >+ * >+ * @param superTypeHierarchy the super type hierarchy >+ * @param method the method >+ * @param recieverType the receiver type for the method >+ * @return the declaring type of the method if the given method is abstract in the receiver >+ * type, else return the receiver type >+ * @throws JavaModelException if the java element does not exist or if an exception occurs while >+ * accessing its corresponding resource >+ * @since 3.6 >+ */ >+ private static IType getDeclaringType(ITypeHierarchy superTypeHierarchy, IMethod method, IType recieverType) throws JavaModelException { >+ MethodOverrideTester methodOverrideTester= new MethodOverrideTester(recieverType, superTypeHierarchy); >+ if (!JdtFlags.isAbstract(methodOverrideTester.findOverriddenMethodInType(recieverType, method))) >+ return recieverType; >+ >+ IMethod overridenMethod= methodOverrideTester.findDeclaringMethod(method, true); >+ return overridenMethod != null ? overridenMethod.getDeclaringType() : method.getDeclaringType(); >+ } >+ >+ /** > * Opens the quick type hierarchy for the given editor. > * > * @param editor the editor for which to open the quick hierarchy
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 288464
:
149619
|
150467
|
151587
|
152156
|
152163
|
152464
|
152469
|
152565