Lines 454-460
Link Here
|
454 |
if (!binding.isValidBinding()) |
454 |
if (!binding.isValidBinding()) |
455 |
return new ProblemReferenceBinding( |
455 |
return new ProblemReferenceBinding( |
456 |
CharOperation.subarray(compoundName, 0, currentIndex), |
456 |
CharOperation.subarray(compoundName, 0, currentIndex), |
457 |
null, // TODO should improve |
457 |
((ReferenceBinding)binding).closestMatch(), |
458 |
binding.problemId()); |
458 |
binding.problemId()); |
459 |
if (!((ReferenceBinding) binding).canBeSeenBy(this)) |
459 |
if (!((ReferenceBinding) binding).canBeSeenBy(this)) |
460 |
return new ProblemReferenceBinding( |
460 |
return new ProblemReferenceBinding( |
Lines 476-486
Link Here
|
476 |
// know binding is now a ReferenceBinding |
476 |
// know binding is now a ReferenceBinding |
477 |
binding = environment().convertToRawType((ReferenceBinding) binding); |
477 |
binding = environment().convertToRawType((ReferenceBinding) binding); |
478 |
while (currentIndex < length) { |
478 |
while (currentIndex < length) { |
479 |
ReferenceBinding typeBinding = (ReferenceBinding) binding; |
479 |
ReferenceBinding referenceBinding = (ReferenceBinding) binding; |
480 |
char[] nextName = compoundName[currentIndex++]; |
480 |
char[] nextName = compoundName[currentIndex++]; |
481 |
invocationSite.setFieldIndex(currentIndex); |
481 |
invocationSite.setFieldIndex(currentIndex); |
482 |
invocationSite.setActualReceiverType(typeBinding); |
482 |
invocationSite.setActualReceiverType(referenceBinding); |
483 |
if ((mask & Binding.FIELD) != 0 && (binding = findField(typeBinding, nextName, invocationSite, true /*resolve*/)) != null) { |
483 |
if ((mask & Binding.FIELD) != 0 && (binding = findField(referenceBinding, nextName, invocationSite, true /*resolve*/)) != null) { |
484 |
if (!binding.isValidBinding()) { |
484 |
if (!binding.isValidBinding()) { |
485 |
return new ProblemFieldBinding( |
485 |
return new ProblemFieldBinding( |
486 |
((ProblemFieldBinding)binding).closestMatch, |
486 |
((ProblemFieldBinding)binding).closestMatch, |
Lines 490-511
Link Here
|
490 |
} |
490 |
} |
491 |
break; // binding is now a field |
491 |
break; // binding is now a field |
492 |
} |
492 |
} |
493 |
if ((binding = findMemberType(nextName, typeBinding)) == null) { |
493 |
if ((binding = findMemberType(nextName, referenceBinding)) == null) { |
494 |
if ((mask & Binding.FIELD) != 0) { |
494 |
if ((mask & Binding.FIELD) != 0) { |
495 |
return new ProblemBinding( |
495 |
return new ProblemBinding( |
496 |
CharOperation.subarray(compoundName, 0, currentIndex), |
496 |
CharOperation.subarray(compoundName, 0, currentIndex), |
497 |
typeBinding, |
497 |
referenceBinding, |
498 |
ProblemReasons.NotFound); |
498 |
ProblemReasons.NotFound); |
499 |
} |
499 |
} |
500 |
return new ProblemReferenceBinding( |
500 |
return new ProblemReferenceBinding( |
501 |
CharOperation.subarray(compoundName, 0, currentIndex), |
501 |
CharOperation.subarray(compoundName, 0, currentIndex), |
502 |
typeBinding, |
502 |
referenceBinding, |
503 |
ProblemReasons.NotFound); |
503 |
ProblemReasons.NotFound); |
504 |
} |
504 |
} |
|
|
505 |
// binding is a ReferenceBinding |
505 |
if (!binding.isValidBinding()) |
506 |
if (!binding.isValidBinding()) |
506 |
return new ProblemReferenceBinding( |
507 |
return new ProblemReferenceBinding( |
507 |
CharOperation.subarray(compoundName, 0, currentIndex), |
508 |
CharOperation.subarray(compoundName, 0, currentIndex), |
508 |
null, // TODO should improve |
509 |
((ReferenceBinding)binding).closestMatch(), |
509 |
binding.problemId()); |
510 |
binding.problemId()); |
510 |
} |
511 |
} |
511 |
if ((mask & Binding.FIELD) != 0 && (binding instanceof FieldBinding)) { |
512 |
if ((mask & Binding.FIELD) != 0 && (binding instanceof FieldBinding)) { |
Lines 563-569
Link Here
|
563 |
if (!binding.isValidBinding()) |
564 |
if (!binding.isValidBinding()) |
564 |
return new ProblemReferenceBinding( |
565 |
return new ProblemReferenceBinding( |
565 |
CharOperation.subarray(compoundName, 0, currentIndex), |
566 |
CharOperation.subarray(compoundName, 0, currentIndex), |
566 |
null, // TODO should improve |
567 |
((ReferenceBinding)binding).closestMatch(), |
567 |
binding.problemId()); |
568 |
binding.problemId()); |
568 |
if (!((ReferenceBinding) binding).canBeSeenBy(this)) |
569 |
if (!((ReferenceBinding) binding).canBeSeenBy(this)) |
569 |
return new ProblemReferenceBinding( |
570 |
return new ProblemReferenceBinding( |
Lines 596-611
Link Here
|
596 |
ProblemReasons.NonStaticReferenceInStaticContext); |
597 |
ProblemReasons.NonStaticReferenceInStaticContext); |
597 |
break foundField; // binding is now a field |
598 |
break foundField; // binding is now a field |
598 |
} |
599 |
} |
599 |
if ((binding = findMemberType(nextName, typeBinding)) == null) |
600 |
if ((binding = findMemberType(nextName, typeBinding)) == null) { |
600 |
return new ProblemBinding( |
601 |
return new ProblemBinding( |
601 |
CharOperation.subarray(compoundName, 0, currentIndex), |
602 |
CharOperation.subarray(compoundName, 0, currentIndex), |
602 |
typeBinding, |
603 |
typeBinding, |
603 |
ProblemReasons.NotFound); |
604 |
ProblemReasons.NotFound); |
604 |
if (!binding.isValidBinding()) |
605 |
} |
|
|
606 |
if (!binding.isValidBinding()) { |
605 |
return new ProblemReferenceBinding( |
607 |
return new ProblemReferenceBinding( |
606 |
CharOperation.subarray(compoundName, 0, currentIndex), |
608 |
CharOperation.subarray(compoundName, 0, currentIndex), |
607 |
null, // TODO should improve |
609 |
((ReferenceBinding)binding).closestMatch(), |
608 |
binding.problemId()); |
610 |
binding.problemId()); |
|
|
611 |
} |
609 |
} |
612 |
} |
610 |
return binding; |
613 |
return binding; |
611 |
} |
614 |
} |