Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
index e90caee3ca..aefb34182f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -273,6 +273,10 @@ public void cacheFlags(IType type, int flags) {
*/
protected void cacheSuperclass(IType type, IType superclass) {
if (superclass != null) {
+ if (superclass.equals(type)) {
+ Util.log(IStatus.ERROR, "Type "+type.getFullyQualifiedName()+" is it's own superclass"); //$NON-NLS-1$//$NON-NLS-2$
+ return; // refuse to enter what could lead to a stackoverflow later
+ }
this.classToSuperclass.put(type, superclass);
addSubtype(superclass, type);
}

Back to the top