Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 288464 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementImplementationHyperlink.java (-3 / +23 lines)
Lines 39-45 Link Here
39
import org.eclipse.jdt.core.IJavaElement;
39
import org.eclipse.jdt.core.IJavaElement;
40
import org.eclipse.jdt.core.IMethod;
40
import org.eclipse.jdt.core.IMethod;
41
import org.eclipse.jdt.core.IType;
41
import org.eclipse.jdt.core.IType;
42
import org.eclipse.jdt.core.ITypeHierarchy;
42
import org.eclipse.jdt.core.ITypeRoot;
43
import org.eclipse.jdt.core.ITypeRoot;
44
import org.eclipse.jdt.core.JavaModelException;
43
import org.eclipse.jdt.core.dom.ASTNode;
45
import org.eclipse.jdt.core.dom.ASTNode;
44
import org.eclipse.jdt.core.dom.CompilationUnit;
46
import org.eclipse.jdt.core.dom.CompilationUnit;
45
import org.eclipse.jdt.core.dom.Expression;
47
import org.eclipse.jdt.core.dom.Expression;
Lines 57-62 Link Here
57
import org.eclipse.jdt.core.search.SearchRequestor;
59
import org.eclipse.jdt.core.search.SearchRequestor;
58
60
59
import org.eclipse.jdt.internal.corext.dom.Bindings;
61
import org.eclipse.jdt.internal.corext.dom.Bindings;
62
import org.eclipse.jdt.internal.corext.refactoring.Checks;
60
import org.eclipse.jdt.internal.corext.util.JdtFlags;
63
import org.eclipse.jdt.internal.corext.util.JdtFlags;
61
import org.eclipse.jdt.internal.corext.util.Messages;
64
import org.eclipse.jdt.internal.corext.util.Messages;
62
65
Lines 184-191 Link Here
184
				parentTypeBinding= Bindings.getBindingOfParentType(node);
187
				parentTypeBinding= Bindings.getBindingOfParentType(node);
185
			}
188
			}
186
		}
189
		}
187
		final IType type= parentTypeBinding != null ? (IType) parentTypeBinding.getJavaElement() : null;
190
		IType type= parentTypeBinding != null ? (IType)parentTypeBinding.getJavaElement() : null;
188
		if (type == null) {
191
		final IType superInterface;
192
193
		try {
194
			ITypeHierarchy superTypeHierarchy= type.newSupertypeHierarchy(null);
195
			IType[] rootInterfaces= superTypeHierarchy.getRootInterfaces();
196
			if (rootInterfaces.length > 1) {
197
				superInterface= null;
198
			} else if (rootInterfaces.length == 1 && Checks.findSimilarMethod((IMethod)javaElement, rootInterfaces[0]) != null) {
199
				superInterface= rootInterfaces[0];
200
			} else {
201
				superInterface= type;
202
			}
203
		} catch (JavaModelException e) {
204
			JavaPlugin.log(e);
205
			return;
206
		}
207
208
		if (superInterface == null) {
189
			openQuickHierarchy(editor);
209
			openQuickHierarchy(editor);
190
			return;
210
			return;
191
		}
211
		}
Lines 219-225 Link Here
219
					Assert.isNotNull(pattern);
239
					Assert.isNotNull(pattern);
220
					SearchParticipant[] participants= new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() };
240
					SearchParticipant[] participants= new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() };
221
					SearchEngine engine= new SearchEngine();
241
					SearchEngine engine= new SearchEngine();
222
					engine.search(pattern, participants, SearchEngine.createHierarchyScope(type), requestor, new SubProgressMonitor(monitor, 100));
242
					engine.search(pattern, participants, SearchEngine.createHierarchyScope(superInterface), requestor, new SubProgressMonitor(monitor, 100));
223
243
224
					if (monitor.isCanceled()) {
244
					if (monitor.isCanceled()) {
225
						throw new OperationCanceledException();
245
						throw new OperationCanceledException();

Return to bug 288464