Lines 396-404
Link Here
|
396 |
|
396 |
|
397 |
ReferenceBinding refType = (ReferenceBinding) type; |
397 |
ReferenceBinding refType = (ReferenceBinding) type; |
398 |
|
398 |
|
399 |
if ((refType.isPrivate() /*|| refType.isLocalType()*/) && !scope.isDefinedInType(refType)) { |
399 |
// Need to to recurse through all enclosing types while setting ExtraCompilerModifiers.AccLocallyUsed bit |
400 |
// ignore cases where type is used from within inside itself |
400 |
// See bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961 |
401 |
((ReferenceBinding)refType.erasure()).modifiers |= ExtraCompilerModifiers.AccLocallyUsed; |
401 |
ReferenceBinding enclosingType = refType; |
|
|
402 |
while (enclosingType != null) { |
403 |
if ((enclosingType.modifiers & ExtraCompilerModifiers.AccLocallyUsed) != 0) { |
404 |
// this flag has been already set for upper enclosing types => end now |
405 |
break; |
406 |
} |
407 |
// TODO Setup this flag even when not private would avoid to recurse twice in same enclosing types... |
408 |
if (enclosingType.isPrivate() && !scope.isDefinedInType(enclosingType)) { |
409 |
// ignore cases where type is used from within inside itself |
410 |
((ReferenceBinding) enclosingType.erasure()).modifiers |= ExtraCompilerModifiers.AccLocallyUsed; |
411 |
} |
412 |
enclosingType = enclosingType.enclosingType(); |
402 |
} |
413 |
} |
403 |
|
414 |
|
404 |
if (refType.hasRestrictedAccess()) { |
415 |
if (refType.hasRestrictedAccess()) { |