|
10 | 10 | *******************************************************************************/ |
11 | 11 | package org.eclipse.jdt.internal.core.search.matching; |
12 | 12 |
|
| 13 | +import java.util.Arrays; |
| 14 | + |
13 | 15 | import org.eclipse.core.runtime.CoreException; |
14 | 16 | import org.eclipse.jdt.core.compiler.CharOperation; |
15 | 17 | import org.eclipse.jdt.core.dom.ASTNode; |
@@ -152,13 +154,16 @@ protected String getQualifiedSourceName(ITypeBinding binding) { |
152 | 154 | return binding.getName(); |
153 | 155 | } |
154 | 156 | protected int resolveLevelForType(char[] simpleNamePattern, char[] qualificationPattern, ITypeBinding binding) { |
155 | | - return resolveLevelForTypeFQN(simpleNamePattern, qualificationPattern, binding, null); |
| 157 | + return |
| 158 | + binding == null && simpleNamePattern == null && qualificationPattern == null ? ACCURATE_MATCH : |
| 159 | + binding != null && binding.isArray() && new String(simpleNamePattern).endsWith("[]") ? resolveLevelForType(Arrays.copyOf(simpleNamePattern, simpleNamePattern.length - 2), qualificationPattern, binding.getComponentType()) : |
| 160 | + resolveLevelForTypeFQN(simpleNamePattern, qualificationPattern, binding, null); |
156 | 161 | } |
157 | 162 |
|
158 | 163 | protected int resolveLevelForTypeFQN(char[] simpleNamePattern, char[] qualificationPattern, ITypeBinding binding, IImportDiscovery discovery) { |
159 | 164 | int level = 0; |
160 | 165 | if (qualificationPattern == null && simpleNamePattern != null) { |
161 | | - level = resolveLevelForTypeSourceName(simpleNamePattern, binding.getErasure().getName().toCharArray(), binding); |
| 166 | + level = resolveLevelForTypeSourceName(simpleNamePattern, (binding.isArray() ? binding : binding.getErasure()).getName().toCharArray(), binding); |
162 | 167 | } |
163 | 168 | if (level == ACCURATE_MATCH || level == ERASURE_MATCH) { |
164 | 169 | return level; |
|
0 commit comments