equal
deleted
inserted
replaced
1054 mask = ConstructorFlags; |
1054 mask = ConstructorFlags; |
1055 } else if ((sym.owner.flags_field & INTERFACE) != 0) { |
1055 } else if ((sym.owner.flags_field & INTERFACE) != 0) { |
1056 if ((sym.owner.flags_field & ANNOTATION) != 0) { |
1056 if ((sym.owner.flags_field & ANNOTATION) != 0) { |
1057 mask = AnnotationTypeElementMask; |
1057 mask = AnnotationTypeElementMask; |
1058 implicit = PUBLIC | ABSTRACT; |
1058 implicit = PUBLIC | ABSTRACT; |
1059 } else if ((flags & (DEFAULT | STATIC)) != 0) { |
1059 } else if ((flags & (DEFAULT | STATIC | PRIVATE)) != 0) { |
1060 mask = InterfaceMethodMask; |
1060 mask = InterfaceMethodMask; |
1061 implicit = PUBLIC; |
1061 implicit = (flags & PRIVATE) != 0 ? 0 : PUBLIC; |
1062 if ((flags & DEFAULT) != 0) { |
1062 if ((flags & DEFAULT) != 0) { |
1063 implicit |= ABSTRACT; |
1063 implicit |= ABSTRACT; |
1064 } |
1064 } |
1065 } else { |
1065 } else { |
1066 mask = implicit = InterfaceMethodFlags; |
1066 mask = implicit = InterfaceMethodFlags; |
1126 checkDisjoint(pos, flags, |
1126 checkDisjoint(pos, flags, |
1127 ABSTRACT, |
1127 ABSTRACT, |
1128 PRIVATE | STATIC | DEFAULT)) |
1128 PRIVATE | STATIC | DEFAULT)) |
1129 && |
1129 && |
1130 checkDisjoint(pos, flags, |
1130 checkDisjoint(pos, flags, |
1131 STATIC, |
1131 STATIC | PRIVATE, |
1132 DEFAULT) |
1132 DEFAULT) |
1133 && |
1133 && |
1134 checkDisjoint(pos, flags, |
1134 checkDisjoint(pos, flags, |
1135 ABSTRACT | INTERFACE, |
1135 ABSTRACT | INTERFACE, |
1136 FINAL | NATIVE | SYNCHRONIZED) |
1136 FINAL | NATIVE | SYNCHRONIZED) |
1621 // handled in validateAnnotationMethod |
1621 // handled in validateAnnotationMethod |
1622 return; |
1622 return; |
1623 } |
1623 } |
1624 |
1624 |
1625 // Error if overriding method has weaker access (JLS 8.4.6.3). |
1625 // Error if overriding method has weaker access (JLS 8.4.6.3). |
1626 if ((origin.flags() & INTERFACE) == 0 && |
1626 if (protection(m.flags()) > protection(other.flags())) { |
1627 protection(m.flags()) > protection(other.flags())) { |
|
1628 log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.weaker.access", |
1627 log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.weaker.access", |
1629 cannotOverride(m, other), |
1628 cannotOverride(m, other), |
1630 (other.flags() & AccessFlags) == 0 ? |
1629 (other.flags() & AccessFlags) == 0 ? |
1631 "package" : |
1630 "package" : |
1632 asFlagSet(other.flags() & AccessFlags)); |
1631 asFlagSet(other.flags() & AccessFlags)); |