Lines 464-485
Link Here
|
464 |
problemReporter().deprecatedType(referenceBinding, invocationNode); |
464 |
problemReporter().deprecatedType(referenceBinding, invocationNode); |
465 |
} |
465 |
} |
466 |
} |
466 |
} |
|
|
467 |
Binding problemFieldBinding = null; |
467 |
while (currentIndex < length) { |
468 |
while (currentIndex < length) { |
468 |
referenceBinding = (ReferenceBinding) binding; |
469 |
referenceBinding = (ReferenceBinding) binding; |
469 |
char[] nextName = compoundName[currentIndex++]; |
470 |
char[] nextName = compoundName[currentIndex++]; |
470 |
invocationSite.setFieldIndex(currentIndex); |
471 |
invocationSite.setFieldIndex(currentIndex); |
471 |
invocationSite.setActualReceiverType(referenceBinding); |
472 |
invocationSite.setActualReceiverType(referenceBinding); |
472 |
if ((mask & Binding.FIELD) != 0 && (binding = findField(referenceBinding, nextName, invocationSite, true /*resolve*/)) != null) { |
473 |
if ((mask & Binding.FIELD) != 0 && (binding = findField(referenceBinding, nextName, invocationSite, true /*resolve*/)) != null) { |
473 |
if (!binding.isValidBinding()) { |
474 |
if (binding.isValidBinding()) { |
474 |
return new ProblemFieldBinding( |
475 |
break; // binding is now a field |
475 |
((ProblemFieldBinding)binding).closestMatch, |
476 |
} |
476 |
((ProblemFieldBinding)binding).declaringClass, |
477 |
problemFieldBinding = new ProblemFieldBinding( |
477 |
CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'), |
478 |
((ProblemFieldBinding)binding).closestMatch, |
478 |
binding.problemId()); |
479 |
((ProblemFieldBinding)binding).declaringClass, |
|
|
480 |
CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'), |
481 |
binding.problemId()); |
482 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=317858 : If field is inaccessible, |
483 |
// don't give up yet, continue to look for a visible member type |
484 |
if (binding.problemId() != ProblemReasons.NotVisible) { |
485 |
return problemFieldBinding; |
479 |
} |
486 |
} |
480 |
break; // binding is now a field |
|
|
481 |
} |
487 |
} |
482 |
if ((binding = findMemberType(nextName, referenceBinding)) == null) { |
488 |
if ((binding = findMemberType(nextName, referenceBinding)) == null) { |
|
|
489 |
if (problemFieldBinding != null) { |
490 |
return problemFieldBinding; |
491 |
} |
483 |
if ((mask & Binding.FIELD) != 0) { |
492 |
if ((mask & Binding.FIELD) != 0) { |
484 |
return new ProblemFieldBinding( |
493 |
return new ProblemFieldBinding( |
485 |
null, |
494 |
null, |
Lines 498-508
Link Here
|
498 |
ProblemReasons.NotFound); |
507 |
ProblemReasons.NotFound); |
499 |
} |
508 |
} |
500 |
// binding is a ReferenceBinding |
509 |
// binding is a ReferenceBinding |
501 |
if (!binding.isValidBinding()) |
510 |
if (!binding.isValidBinding()) { |
|
|
511 |
if (problemFieldBinding != null) { |
512 |
return problemFieldBinding; |
513 |
} |
502 |
return new ProblemReferenceBinding( |
514 |
return new ProblemReferenceBinding( |
503 |
CharOperation.subarray(compoundName, 0, currentIndex), |
515 |
CharOperation.subarray(compoundName, 0, currentIndex), |
504 |
(ReferenceBinding)((ReferenceBinding)binding).closestMatch(), |
516 |
(ReferenceBinding)((ReferenceBinding)binding).closestMatch(), |
505 |
binding.problemId()); |
517 |
binding.problemId()); |
|
|
518 |
} |
506 |
if (invocationSite instanceof ASTNode) { |
519 |
if (invocationSite instanceof ASTNode) { |
507 |
referenceBinding = (ReferenceBinding) binding; |
520 |
referenceBinding = (ReferenceBinding) binding; |
508 |
ASTNode invocationNode = (ASTNode) invocationSite; |
521 |
ASTNode invocationNode = (ASTNode) invocationSite; |