Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2017-01-22 22:24:15 +0000
committerStephan Herrmann2017-01-22 22:24:15 +0000
commit5b876ff8fddc30314b384e78618ad6f489044c62 (patch)
tree51f509aee08bfc9a757ccc6f6e7b3acb35e65c29
parent56302ab428c27ffba74ba4267060c9b92a2f2038 (diff)
downloadeclipse.jdt.core-5b876ff8fddc30314b384e78618ad6f489044c62.tar.gz
eclipse.jdt.core-5b876ff8fddc30314b384e78618ad6f489044c62.tar.xz
eclipse.jdt.core-5b876ff8fddc30314b384e78618ad6f489044c62.zip
Bug 476933: StackOverflowError in JavaElement.equals
(JavaElement.java:176) Change-Id: Ib892846e7d44da4e4dc34de8cc5fd58d3489c568 Signed-off-by: Stephan Herrmann <stephan.herrmann@berlin.de>
-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