View | Details | Raw Unified | Return to bug 186781
Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-2 / +6 lines)
Lines 3620-3632 Link Here
3620
					ICompilationUnit unit = JavaModelManager.createCompilationUnitFrom((IFile)resource, null);
3620
					ICompilationUnit unit = JavaModelManager.createCompilationUnitFrom((IFile)resource, null);
3621
					if (unit != null) {
3621
					if (unit != null) {
3622
						String typeString = new String(typeName);
3622
						String typeString = new String(typeName);
3623
						String packageString = new String(packageName);
3623
						IType type = unit.getType(typeString);
3624
						// String packageString = new String(packageName);
3625
						// use package fragment name instead of parameter as it may be invalid...
3626
						// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=186781
3627
						String packageString = type.getPackageFragment().getElementName();
3624
						HashMap packageTypes = (HashMap) allTypes.get(packageString);
3628
						HashMap packageTypes = (HashMap) allTypes.get(packageString);
3625
						if (packageTypes == null) {
3629
						if (packageTypes == null) {
3626
							packageTypes = new HashMap(3);
3630
							packageTypes = new HashMap(3);
3627
							allTypes.put(packageString, packageTypes);
3631
							allTypes.put(packageString, packageTypes);
3628
						}
3632
						}
3629
						packageTypes.put(typeString, unit.getType(typeString));
3633
						packageTypes.put(typeString, type);
3630
					}
3634
					}
3631
					if (VERBOSE) {
3635
					if (VERBOSE) {
3632
						Util.verbose("	- indexing cache:"); //$NON-NLS-1$
3636
						Util.verbose("	- indexing cache:"); //$NON-NLS-1$
(-)search/org/eclipse/jdt/internal/core/index/DiskIndex.java (-1 / +1 lines)
Lines 46-52 Link Here
46
private int streamEnd; // used when writing data from the streamBuffer to the file
46
private int streamEnd; // used when writing data from the streamBuffer to the file
47
char separator = Index.DEFAULT_SEPARATOR;
47
char separator = Index.DEFAULT_SEPARATOR;
48
48
49
public static final String SIGNATURE= "INDEX VERSION 1.123"; //$NON-NLS-1$
49
public static final String SIGNATURE= "INDEX VERSION 1.124"; //$NON-NLS-1$
50
private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray();
50
private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray();
51
public static boolean DEBUG = false;
51
public static boolean DEBUG = false;
52
52
(-)src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java (+18 lines)
Lines 1877-1880 Link Here
1877
		hierarchy
1877
		hierarchy
1878
	);
1878
	);
1879
}
1879
}
1880
1881
/**
1882
 * @bug 186781: StackOverflowError while computing launch button tooltip
1883
 * @test Verify that StackOverflowException does no longer occur with the given test case
1884
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=186781"
1885
 */
1886
public void testBug186781() throws JavaModelException {
1887
	IType type = getCompilationUnit("/TypeHierarchy/src/q186871/X.java").getType("X");
1888
	assertTrue("Type should exist!", type.exists());
1889
	ITypeHierarchy hierarchy = type.newTypeHierarchy(null); // when bug occurred a stack overflow happened here...
1890
	assertHierarchyEquals(
1891
		"Focus: X [in X.java [in q186871 [in src [in TypeHierarchy]]]]\n" + 
1892
		"Super types:\n" + 
1893
		"  Super [in X.java [in q186871 [in src [in TypeHierarchy]]]]\n" + 
1894
		"    Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" + 
1895
		"Sub types:\n",
1896
		hierarchy);
1897
}
1880
}
1898
}
(-)workspace/TypeHierarchy/src/q186871/X.java (+6 lines)
Added Link Here
1
package p186871;
2
import static p186871.Super.A.*;
3
class Super {
4
	static class A {}
5
}
6
public class X extends Super {}
(-)workspace/TypeHierarchy/src/p186871/X.java (+5 lines)
Added Link Here
1
package p186871;
2
3
public class X {
4
5
}

Return to bug 186781