&& propertyIsDeclaredButNotPrivate(getprop, parent)) {
compiler.report(t.makeError(getprop, CONVENTION_MISMATCH));
return;
}
StaticSourceFile definingSource = getDefiningSource(
getprop, referenceType, propertyName);
boolean isClassType = false;
// Is this a normal property access, or are we trying to override
// an existing property?
boolean isOverride = parent.getJSDocInfo() != null
&& parent.isAssign()
&& parent.getFirstChild() == getprop;
ObjectType objectType = getObjectType(
referenceType, isOverride, propertyName);
Visibility fileOverviewVisibility =
defaultVisibilityForFiles.get(definingSource);
Visibility visibility = AccessControlUtils.getEffectivePropertyVisibility(
getprop,
referenceType,
defaultVisibilityForFiles,
enforceCodingConventions ? compiler.getCodingConvention() : null);
if (isOverride) {
Visibility overriding = getOverridingPropertyVisibility(parent);
if (overriding != null) {
checkOverriddenPropertyVisibilityMismatch(
overriding, visibility, fileOverviewVisibility, t, getprop);
}
}
if (objectType != null) {
JSDocInfo docInfo = objectType.getOwnPropertyJSDocInfo(propertyName);
definingSource = docInfo.getStaticSourceFile();
isClassType = docInfo.isConstructor();
} else if (isPrivateByConvention) {
// We can only check visibility references if we know what file
// it was defined in.
objectType = referenceType;
} else if (fileOverviewVisibility == null) {
// Otherwise just assume the property is public.
return;
}
StaticSourceFile referenceSource = getprop.getStaticSourceFile();
if (isOverride) {
boolean sameInput = referenceSource != null
&& referenceSource.getName().equals(definingSource.getName());
checkOverriddenPropertyVisibility(
t,
getprop,
parent,
visibility,