Skip to content

Commit d9438d4

Browse files
committed
Remove unused IndexBasedHierarchyBuilder.cuToHandle map that leak memory
This map isn't used since ~20 years but still leaks memory. Fixes #1184
1 parent 7bf3a07 commit d9438d4

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.Iterator;
2222
import java.util.Map;
2323

24-
import org.eclipse.core.resources.IFile;
2524
import org.eclipse.core.resources.IResource;
2625
import org.eclipse.core.runtime.IPath;
2726
import org.eclipse.core.runtime.IProgressMonitor;
@@ -40,7 +39,6 @@
4039
import org.eclipse.jdt.core.search.SearchPattern;
4140
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
4241
import org.eclipse.jdt.internal.compiler.env.IBinaryType;
43-
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
4442
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
4543
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
4644
import org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToInt;
@@ -69,13 +67,6 @@
6967
@SuppressWarnings({ "rawtypes", "unchecked" })
7068
public class IndexBasedHierarchyBuilder extends HierarchyBuilder implements SuffixConstants {
7169
public static final int MAXTICKS = 800; // heuristic so that there still progress for deep hierachies
72-
/**
73-
* A temporary cache of compilation units to handles to speed info
74-
* to handle translation - it only contains the entries
75-
* for the types in the region (in other words, it contains no supertypes outside
76-
* the region).
77-
*/
78-
protected Map cuToHandle;
7970

8071
/**
8172
* The scope this hierarchy builder should restrain results to.
@@ -134,7 +125,6 @@ private static class SubtypeQuery {
134125

135126
public IndexBasedHierarchyBuilder(TypeHierarchy hierarchy, IJavaSearchScope scope) throws JavaModelException {
136127
super(hierarchy);
137-
this.cuToHandle = new HashMap(5);
138128
this.binariesFromIndexMatches = new HashMap(10);
139129
this.scope = scope;
140130
}
@@ -404,12 +394,7 @@ private void buildFromPotentialSubtypes(String[] allPotentialSubTypes, HashSet l
404394
SubMonitor.done(monitor);
405395
}
406396
}
407-
@Override
408-
protected ICompilationUnit createCompilationUnitFromPath(Openable handle, IFile file, char[] moduleName) {
409-
ICompilationUnit unit = super.createCompilationUnitFromPath(handle, file, moduleName);
410-
this.cuToHandle.put(unit, handle);
411-
return unit;
412-
}
397+
413398
@Override
414399
protected IBinaryType createInfoFromClassFile(Openable classFile, IResource file) {
415400
String documentPath = classFile.getPath().toString();

0 commit comments

Comments
 (0)