diff options
author | Andrey Loskutov | 2019-05-11 19:04:23 +0000 |
---|---|---|
committer | Andrey Loskutov | 2019-05-11 19:04:23 +0000 |
commit | 97d56a861f97b4c7ba07d96dd452a88dcff1c1c9 (patch) | |
tree | 038e98a80a943a8dd1d7d9a28aa493e891cec041 /org.eclipse.jdt.core/model/org/eclipse/jdt | |
parent | 66765d11a86c7477838a39eafba6169fca506ed3 (diff) | |
download | eclipse.jdt.core-97d56a861f97b4c7ba07d96dd452a88dcff1c1c9.tar.gz eclipse.jdt.core-97d56a861f97b4c7ba07d96dd452a88dcff1c1c9.tar.xz eclipse.jdt.core-97d56a861f97b4c7ba07d96dd452a88dcff1c1c9.zip |
Bug 547051 - subclass search with patterns doesn't work for modulesI20190511-1800
Updated IndexBasedHierarchyBuilder.createInfoFromClassFileInJar() to
include module name of the given type.
Change-Id: I3e1a2842728b7e576472ea9534a0ea3753e3b73d
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jdt.core/model/org/eclipse/jdt')
-rw-r--r-- | org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java index 3ff7bca478..7ec88709e6 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java @@ -32,6 +32,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.IModuleDescription; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; @@ -427,7 +428,15 @@ protected IBinaryType createInfoFromClassFileInJar(Openable classFile) { IPath path = root.getPath(); // take the OS path for external jars, and the forward slash path for internal jars String rootPath = path.getDevice() == null ? path.toString() : path.toOSString(); - String documentPath = rootPath + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + filePath; + IModuleDescription md = root.getModuleDescription(); + String documentPath; + if(md != null) { + String module = md.getElementName(); + documentPath = rootPath + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + + module + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + filePath; + } else { + documentPath = rootPath + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + filePath; + } IBinaryType binaryType = (IBinaryType)this.binariesFromIndexMatches.get(documentPath); if (binaryType != null) { this.infoToHandle.put(binaryType, classFile); |