From 7d2f3816e3019b7612b1795282a19f6022a10e02 Mon Sep 17 00:00:00 2001 From: Stephan Herrmann Date: Wed, 23 Oct 2024 21:22:40 +0200 Subject: [PATCH] remove conditional checks that are now obsolete --- .../eclipse/jdt/internal/compiler/ast/CaseStatement.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java index 083bdaf4cf7..3b3b038560e 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java @@ -382,12 +382,6 @@ private Constant resolveCasePattern(BlockScope scope, TypeBinding caseType, Type if (!e.isApplicable(switchExpressionType, scope, e)) { return Constant.NotAConstant; } - if (expressionType != TypeBinding.NULL && !(e instanceof RecordPattern)) { - boolean isLegal = e.checkCastTypesCompatibility(scope, type, expressionType, e, false); - if (!isLegal || (e.bits & ASTNode.UnsafeCast) != 0) { - scope.problemReporter().unsafeCastInTestingContext(e, type, expressionType); - } - } } else if (type.isValidBinding()) { // if not a valid binding, an error has already been reported for unresolved type if (Pattern.findPrimitiveConversionRoute(type, expressionType, scope) == PrimitiveConversionRoute.NO_CONVERSION_ROUTE) {