From eaf0ba3aee5225eb35e7d9ceacf07771ac88f17a Mon Sep 17 00:00:00 2001 From: Leon Schenk <989485+leonschenk@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:01:07 +0200 Subject: [PATCH] HHH-18675: Revert to java 11 --- .../org/hibernate/metamodel/internal/MetadataContext.java | 4 ++-- .../orm/test/manytomany/generic/ManyToManyNonGenericTest.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java index 418129ca13..863cd8f921 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java @@ -280,8 +280,8 @@ public class MetadataContext { if ( !property.isGeneric() ) { final PersistentAttribute concreteAttribute = factoryFunction.apply( entityType, property ); if ( concreteAttribute != null ) { - @SuppressWarnings("unchecked") final AttributeContainer attributeContainer = (AttributeContainer) entityType; - attributeContainer.getInFlightAccess().addConcreteGenericAttribute( concreteAttribute ); + //noinspection unchecked + ( (AttributeContainer) entityType ).getInFlightAccess().addConcreteGenericAttribute( concreteAttribute ); } } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/manytomany/generic/ManyToManyNonGenericTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/manytomany/generic/ManyToManyNonGenericTest.java index 6a11cf31bf..8a10874c8b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/manytomany/generic/ManyToManyNonGenericTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/manytomany/generic/ManyToManyNonGenericTest.java @@ -25,6 +25,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; +import java.util.stream.Collectors; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; @@ -102,7 +103,7 @@ public class ManyToManyNonGenericTest { @Override public String toString() { - return "node [%s] parent of %s".formatted(id, children.stream().map(n -> n.id).toList()); + return String.format("node [%s] parent of %s", id, children.stream().map(n -> n.id).collect(Collectors.toList())); } } }