From 8dd2fdd3000d2f861c4e1857e3f8b2e45109ed36 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 29 Apr 2019 10:01:43 +0200 Subject: [PATCH] DATAJPA-1530 - Polishing. Clean up warning suppressions. Original pull request: #376. --- .../repository/support/JpaMetamodelEntityInformation.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java b/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java index 1573f4886..7c80c211a 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformation.java @@ -283,8 +283,8 @@ public class JpaMetamodelEntityInformation extends JpaEntityInformationSu private Class tryExtractIdTypeWithFallbackToIdTypeLookup() { try { - Type idType2 = type.getIdType(); - return idType2 == null ? fallbackIdTypeLookup(type) : idType2.getJavaType(); + Type idType = type.getIdType(); + return idType == null ? fallbackIdTypeLookup(type) : idType.getJavaType(); } catch (IllegalStateException e) { // see https://hibernate.onjira.com/browse/HHH-6951 return fallbackIdTypeLookup(type); @@ -334,7 +334,7 @@ public class JpaMetamodelEntityInformation extends JpaEntityInformationSu * entity that is part of the id key. If this is the case, we need to derive the identifier of the nested entity. */ @Override - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) public void setPropertyValue(String propertyName, @Nullable Object value) { if (!isIdentifierDerivationNecessary(value)) { @@ -343,7 +343,6 @@ public class JpaMetamodelEntityInformation extends JpaEntityInformationSu } // Derive the identifier from the nested entity that is part of the composite key. - @SuppressWarnings("rawtypes") JpaMetamodelEntityInformation nestedEntityInformation = new JpaMetamodelEntityInformation( ProxyUtils.getUserClass(value), this.metamodel);