Lines 244-255
Link Here
|
244 |
// TODO (jerome) filter out synthetic members |
244 |
// TODO (jerome) filter out synthetic members |
245 |
// indexer should not index them as well |
245 |
// indexer should not index them as well |
246 |
// if ((methodInfo.getModifiers() & IConstants.AccSynthetic) != 0) continue; // skip synthetic |
246 |
// if ((methodInfo.getModifiers() & IConstants.AccSynthetic) != 0) continue; // skip synthetic |
|
|
247 |
boolean useGenericSignature = true; |
247 |
char[] signature = methodInfo.getGenericSignature(); |
248 |
char[] signature = methodInfo.getGenericSignature(); |
248 |
if (signature == null) signature = methodInfo.getMethodDescriptor(); |
249 |
if (signature == null) { |
|
|
250 |
useGenericSignature = false; |
251 |
signature = methodInfo.getMethodDescriptor(); |
252 |
} |
253 |
String selector = new String(methodInfo.getSelector()); |
254 |
final boolean isConstructor = methodInfo.isConstructor(); |
255 |
if (isConstructor) { |
256 |
selector = type.getElementName(); |
257 |
} |
249 |
String[] pNames = null; |
258 |
String[] pNames = null; |
250 |
try { |
259 |
try { |
251 |
pNames = Signature.getParameterTypes(new String(signature)); |
260 |
pNames = Signature.getParameterTypes(new String(signature)); |
252 |
} catch (IllegalArgumentException e) { |
261 |
if (isConstructor |
|
|
262 |
&& useGenericSignature |
263 |
&& type.isMember() |
264 |
&& !Flags.isStatic(type.getFlags())) { |
265 |
int length = pNames.length; |
266 |
System.arraycopy(pNames, 0, (pNames = new String[length + 1]), 1, length); |
267 |
char[] descriptor = methodInfo.getMethodDescriptor(); |
268 |
final String[] parameterTypes = Signature.getParameterTypes(new String(descriptor)); |
269 |
pNames[0] = parameterTypes[0]; |
270 |
} |
271 |
}catch (IllegalArgumentException e) { |
272 |
// protect against malformed .class file (e.g. com/sun/crypto/provider/SunJCE_b.class has a 'a' generic signature) |
273 |
signature = methodInfo.getMethodDescriptor(); |
274 |
pNames = Signature.getParameterTypes(new String(signature)); |
275 |
} catch (JavaModelException e) { |
253 |
// protect against malformed .class file (e.g. com/sun/crypto/provider/SunJCE_b.class has a 'a' generic signature) |
276 |
// protect against malformed .class file (e.g. com/sun/crypto/provider/SunJCE_b.class has a 'a' generic signature) |
254 |
signature = methodInfo.getMethodDescriptor(); |
277 |
signature = methodInfo.getMethodDescriptor(); |
255 |
pNames = Signature.getParameterTypes(new String(signature)); |
278 |
pNames = Signature.getParameterTypes(new String(signature)); |
Lines 260-269
Link Here
|
260 |
} |
283 |
} |
261 |
char[][] parameterTypes = ClassFile.translatedNames(paramNames); |
284 |
char[][] parameterTypes = ClassFile.translatedNames(paramNames); |
262 |
JavaModelManager manager = JavaModelManager.getJavaModelManager(); |
285 |
JavaModelManager manager = JavaModelManager.getJavaModelManager(); |
263 |
String selector = new String(methodInfo.getSelector()); |
|
|
264 |
if (methodInfo.isConstructor()) { |
265 |
selector =type.getElementName(); |
266 |
} |
267 |
selector = manager.intern(selector); |
286 |
selector = manager.intern(selector); |
268 |
for (int j= 0; j < pNames.length; j++) { |
287 |
for (int j= 0; j < pNames.length; j++) { |
269 |
pNames[j]= manager.intern(new String(parameterTypes[j])); |
288 |
pNames[j]= manager.intern(new String(parameterTypes[j])); |