Lines 410-444
Link Here
|
410 |
*/ |
410 |
*/ |
411 |
public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo, boolean isReadAccess) { |
411 |
public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo, boolean isReadAccess) { |
412 |
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) != 0) return; |
412 |
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) != 0) return; |
413 |
|
413 |
|
414 |
// if field from parameterized type got found, use the original field at codegen time |
414 |
// if field from parameterized type got found, use the original field at codegen time |
415 |
FieldBinding codegenBinding = this.binding.original(); |
415 |
FieldBinding codegenBinding = this.binding.original(); |
416 |
|
|
|
417 |
if (this.binding.isPrivate()) { |
416 |
if (this.binding.isPrivate()) { |
418 |
if ((currentScope.enclosingSourceType() != codegenBinding.declaringClass) |
417 |
if ((currentScope.enclosingSourceType() != codegenBinding.declaringClass) |
419 |
&& this.binding.constant() == Constant.NotAConstant) { |
418 |
&& this.binding.constant() == Constant.NotAConstant) { |
420 |
if (this.syntheticAccessors == null) |
419 |
if (this.syntheticAccessors == null) |
421 |
this.syntheticAccessors = new MethodBinding[2]; |
420 |
this.syntheticAccessors = new MethodBinding[2]; |
422 |
this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = |
421 |
this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = |
423 |
((SourceTypeBinding) codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, isReadAccess); |
422 |
((SourceTypeBinding) codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, isReadAccess, isSuperAccess()); |
424 |
currentScope.problemReporter().needToEmulateFieldAccess(codegenBinding, this, isReadAccess); |
423 |
currentScope.problemReporter().needToEmulateFieldAccess(codegenBinding, this, isReadAccess); |
425 |
return; |
424 |
return; |
426 |
} |
425 |
} |
427 |
|
|
|
428 |
} else if (this.receiver instanceof QualifiedSuperReference) { // qualified super |
426 |
} else if (this.receiver instanceof QualifiedSuperReference) { // qualified super |
429 |
|
|
|
430 |
// qualified super need emulation always |
427 |
// qualified super need emulation always |
431 |
SourceTypeBinding destinationType = |
428 |
SourceTypeBinding destinationType = |
432 |
(SourceTypeBinding) (((QualifiedSuperReference) this.receiver) |
429 |
(SourceTypeBinding) (((QualifiedSuperReference) this.receiver) |
433 |
.currentCompatibleType); |
430 |
.currentCompatibleType); |
434 |
if (this.syntheticAccessors == null) |
431 |
if (this.syntheticAccessors == null) |
435 |
this.syntheticAccessors = new MethodBinding[2]; |
432 |
this.syntheticAccessors = new MethodBinding[2]; |
436 |
this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = destinationType.addSyntheticMethod(codegenBinding, isReadAccess); |
433 |
this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = destinationType.addSyntheticMethod(codegenBinding, isReadAccess, isSuperAccess()); |
437 |
currentScope.problemReporter().needToEmulateFieldAccess(codegenBinding, this, isReadAccess); |
434 |
currentScope.problemReporter().needToEmulateFieldAccess(codegenBinding, this, isReadAccess); |
438 |
return; |
435 |
return; |
439 |
|
436 |
|
440 |
} else if (this.binding.isProtected()) { |
437 |
} else if (this.binding.isProtected()) { |
441 |
|
|
|
442 |
SourceTypeBinding enclosingSourceType; |
438 |
SourceTypeBinding enclosingSourceType; |
443 |
if (((this.bits & ASTNode.DepthMASK) != 0) |
439 |
if (((this.bits & ASTNode.DepthMASK) != 0) |
444 |
&& this.binding.declaringClass.getPackage() |
440 |
&& this.binding.declaringClass.getPackage() |
Lines 449-455
Link Here
|
449 |
(this.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT); |
445 |
(this.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT); |
450 |
if (this.syntheticAccessors == null) |
446 |
if (this.syntheticAccessors == null) |
451 |
this.syntheticAccessors = new MethodBinding[2]; |
447 |
this.syntheticAccessors = new MethodBinding[2]; |
452 |
this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = currentCompatibleType.addSyntheticMethod(codegenBinding, isReadAccess); |
448 |
this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] = currentCompatibleType.addSyntheticMethod(codegenBinding, isReadAccess, isSuperAccess()); |
453 |
currentScope.problemReporter().needToEmulateFieldAccess(codegenBinding, this, isReadAccess); |
449 |
currentScope.problemReporter().needToEmulateFieldAccess(codegenBinding, this, isReadAccess); |
454 |
return; |
450 |
return; |
455 |
} |
451 |
} |