JCDiagnostic getDiagnostic(DiagnosticType dkind,
DiagnosticPosition pos,
Symbol location,
Type site,
Name name,
List<Type> argtypes,
List<Type> typeargtypes) {
if (sym.owner.type.tag == ERROR)
return null;
if (sym.name == names.init && sym.owner != site.tsym) {
return new SymbolNotFoundError(ABSENT_MTH).getDiagnostic(dkind,
pos, location, site, name, argtypes, typeargtypes);
}
else if ((sym.flags() & PUBLIC) != 0
|| (env != null && this.site != null
&& !isAccessible(env, this.site))) {
return diags.create(dkind, log.currentSource(),
pos, "not.def.access.class.intf.cant.access",
sym, sym.location());
}
else if ((sym.flags() & (PRIVATE | PROTECTED)) != 0) {
return diags.create(dkind, log.currentSource(),
pos, "report.access", sym,
asFlagSet(sym.flags() & (PRIVATE | PROTECTED)),
sym.location());
}
else {
return diags.create(dkind, log.currentSource(),
pos, "not.def.public.cant.access", sym, sym.location());
}
}
|