From 5d5ce3feda423c5cdc865876494f0dc4dc658204 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Thu, 14 Nov 2024 10:40:27 +0100 Subject: [PATCH] clean up unused instance variables --- .../hbm/transform/BootModelPreprocessor.java | 13 ++----------- .../jaxb/hbm/transform/HbmXmlTransformer.java | 19 +++---------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/BootModelPreprocessor.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/BootModelPreprocessor.java index d79d542920..6a26a37d80 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/BootModelPreprocessor.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/BootModelPreprocessor.java @@ -5,13 +5,10 @@ package org.hibernate.boot.jaxb.hbm.transform; import java.util.HashMap; -import java.util.List; import java.util.Locale; import java.util.Map; import org.hibernate.MappingException; -import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmHibernateMapping; -import org.hibernate.boot.jaxb.spi.Binding; import org.hibernate.boot.spi.MetadataImplementor; import org.hibernate.mapping.Collection; import org.hibernate.mapping.Component; @@ -21,7 +18,6 @@ import org.hibernate.mapping.Property; import org.hibernate.mapping.RootClass; import org.hibernate.mapping.Table; import org.hibernate.mapping.ToOne; -import org.hibernate.service.ServiceRegistry; /** * @author Steve Ebersole @@ -29,25 +25,20 @@ import org.hibernate.service.ServiceRegistry; public class BootModelPreprocessor { private static final Map entityByNameMap = new HashMap<>(); - static void preprocessBooModel( - List> hbmXmlBindings, - MetadataImplementor bootModel, - ServiceRegistry serviceRegistry, - TransformationState transformationState) { + static void preprocessBooModel(MetadataImplementor bootModel, TransformationState transformationState) { entityByNameMap.clear(); bootModel.getEntityBindings().forEach( (persistentClass) -> { final Table table = TransformationHelper.determineEntityTable( persistentClass ); final EntityTypeInfo entityTypeInfo = new EntityTypeInfo( table, persistentClass ); transformationState.getEntityInfoByName().put( persistentClass.getEntityName(), entityTypeInfo ); - buildPersistentClassPropertyInfos( persistentClass, entityTypeInfo, bootModel, transformationState ); + buildPersistentClassPropertyInfos( persistentClass, entityTypeInfo, transformationState ); } ); } private static void buildPersistentClassPropertyInfos( PersistentClass persistentClass, EntityTypeInfo entityTypeInfo, - MetadataImplementor bootModel, TransformationState transformationState) { if ( persistentClass.getClassName() != null ) { final String previous = entityByNameMap.put( persistentClass.getClassName(), persistentClass.getEntityName() ); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java index c0c50c5792..842ca4feb8 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java @@ -231,12 +231,7 @@ public class HbmXmlTransformer { final List> transformations = XmlPreprocessor.preprocessHbmXml( hbmXmlBindings, transformationState ); // build and perform a pass over the boot model building the rest of the transformation-state - BootModelPreprocessor.preprocessBooModel( - hbmXmlBindings, - bootModel, - serviceRegistry, - transformationState - ); + BootModelPreprocessor.preprocessBooModel( bootModel, transformationState ); // now we are ready to fully build the mapping.xml transformations for ( int i = 0; i < hbmXmlBindings.size(); i++ ) { @@ -244,9 +239,7 @@ public class HbmXmlTransformer { hbmXmlBindings.get( i ), transformations.get( i ), transformationState, - bootModel, - unsupportedFeatureHandling, - serviceRegistry + unsupportedFeatureHandling ); hbmXmlTransformer.performTransformation(); @@ -260,10 +253,8 @@ public class HbmXmlTransformer { private final Binding mappingXmlBinding; private final TransformationState transformationState; - private final MetadataImplementor bootModel; private final UnsupportedFeatureHandling unsupportedFeatureHandling; - private final ServiceRegistry serviceRegistry; // todo (7.0) : use transformation-state instead private final Map jaxbEmbeddableByClassName = new HashMap<>(); @@ -274,15 +265,11 @@ public class HbmXmlTransformer { Binding hbmXmlBinding, Binding mappingXmlBinding, TransformationState transformationState, - MetadataImplementor bootModel, - UnsupportedFeatureHandling unsupportedFeatureHandling, - ServiceRegistry serviceRegistry) { + UnsupportedFeatureHandling unsupportedFeatureHandling) { this.hbmXmlBinding = hbmXmlBinding; this.mappingXmlBinding = mappingXmlBinding; this.transformationState = transformationState; - this.bootModel = bootModel; this.unsupportedFeatureHandling = unsupportedFeatureHandling; - this.serviceRegistry = serviceRegistry; }