From 5cd29067470dc12059e18647fab06c1a33c692e6 Mon Sep 17 00:00:00 2001 From: Srikanth Sankaran <131454720+srikanth-sankaran@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:21:30 +0530 Subject: [PATCH] Clean up formatting problems and stale comments from previous commit (#2640) --- .../org/eclipse/jdt/internal/compiler/ast/Expression.java | 2 -- .../jdt/internal/compiler/lookup/ReferenceBinding.java | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java index 778c906c217..db2e4adff30 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java @@ -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) { @@ -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; } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java index dcdc2d644c0..0d4b2c04984 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java @@ -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())