Skip to content

Commit

Permalink
Clean up formatting problems and stale comments from previous commit (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth-sankaran authored and gayanper committed Sep 7, 2024
1 parent a4d1301 commit ecaa251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ public final boolean checkCastTypesCompatibility(Scope scope, TypeBinding castTy
return checkUnsafeCast(scope, castType, expressionType, match, true);
}
if (((ReferenceBinding) castType).isDisjointFrom((ReferenceBinding) expressionType)) {
// no subclass for castType, thus compile-time check is invalid
return false;
}
if (use15specifics) {
Expand Down Expand Up @@ -556,7 +555,6 @@ public final boolean checkCastTypesCompatibility(Scope scope, TypeBinding castTy
if (match != null) {
return checkUnsafeCast(scope, castType, expressionType, match, false);
}
// unless final, a subclass may implement the interface ==> no check at compile time
if (refExprType.isDisjointFrom((ReferenceBinding) castType)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2603,10 +2603,10 @@ public boolean isDisjointFrom(ReferenceBinding that) {
} else {
if (that.isInterface()) {
/* • A class named C is disjoint from an interface named I if (i) it is not the case that C <: I, and (ii) one of the following cases applies:
– C is final.
– C is sealed, and all of the permitted direct subclasses of C are disjoint from I.
– C is freely extensible (§8.1.1.2), and I is sealed, and C is disjoint from all of the permitted direct subclasses and subinterfaces of I
*/
– C is final.
– C is sealed, and all of the permitted direct subclasses of C are disjoint from I.
– C is freely extensible (§8.1.1.2), and I is sealed, and C is disjoint from all of the permitted direct subclasses and subinterfaces of I
*/
if (this.findSuperTypeOriginatingFrom(that) != null)
return false;
if (this.isFinal())
Expand Down

0 comments on commit ecaa251

Please sign in to comment.