|
Lines 535-552
Link Here
|
| 535 |
String[] names= null; |
535 |
String[] names= null; |
| 536 |
if (getFlag(flags, M_PARAMETER_NAMES) && method.exists()) { |
536 |
if (getFlag(flags, M_PARAMETER_NAMES) && method.exists()) { |
| 537 |
names= method.getParameterNames(); |
537 |
names= method.getParameterNames(); |
|
|
538 |
int namesLength = names.length; |
| 538 |
if (types == null) { |
539 |
if (types == null) { |
| 539 |
nParams= names.length; |
540 |
nParams= namesLength; |
| 540 |
} else { |
541 |
} else if (nParams < namesLength) { |
| 541 |
if (nParams != names.length) { |
542 |
// unexpected number of parameter names |
| 542 |
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=99137 and |
543 |
names = null; |
| 543 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=101029 |
544 |
} else if (nParams > namesLength) { |
| 544 |
// JavaPlugin.logErrorMessage("JavaElementLabels: Number of param types(" + nParams + ") != number of names(" + names.length + "): " + method.getElementName()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ |
545 |
// assume that extra parameter types are synthetic |
| 545 |
names= null; // no names rendered |
546 |
if (namesLength == 0) { |
|
|
547 |
// no param to display |
| 548 |
nParams = 0; |
| 549 |
} else if (resolvedSig == null) { |
| 550 |
// unexpected number of parameter types/names |
| 551 |
names = null; |
| 552 |
} else { |
| 553 |
// reduce get types to number of names |
| 554 |
int size = nParams - namesLength; |
| 555 |
nParams -= size; |
| 556 |
System.arraycopy(types, size, types = new String[namesLength], 0, namesLength); |
| 546 |
} |
557 |
} |
| 547 |
} |
558 |
} |
| 548 |
} |
559 |
} |
| 549 |
|
|
|
| 550 |
for (int i= 0; i < nParams; i++) { |
560 |
for (int i= 0; i < nParams; i++) { |
| 551 |
if (i > 0) { |
561 |
if (i > 0) { |
| 552 |
buf.append(COMMA_STRING); |
562 |
buf.append(COMMA_STRING); |