HHH-12606 Container contents are never accessed

https://hibernate.atlassian.net/browse/HHH-12606
This commit is contained in:
Philippe Marschall 2018-05-19 22:44:21 +02:00 committed by Sanne Grinovero
parent 3489f75e1d
commit 83c6b56fc8
2 changed files with 1 additions and 17 deletions

View File

@ -6,10 +6,6 @@
*/ */
package org.hibernate.bytecode.internal.bytebuddy; package org.hibernate.bytecode.internal.bytebuddy;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.hibernate.AssertionFailure; import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.bytecode.spi.BasicProxyFactory; import org.hibernate.bytecode.spi.BasicProxyFactory;
@ -35,15 +31,7 @@ public class BasicProxyFactoryImpl implements BasicProxyFactory {
throw new AssertionFailure( "attempting to build proxy without any superclass or interfaces" ); throw new AssertionFailure( "attempting to build proxy without any superclass or interfaces" );
} }
Class<?> superClassOrMainInterface = superClass != null ? superClass : interfaces[0]; final Class<?> superClassOrMainInterface = superClass != null ? superClass : interfaces[0];
Set<Class> key = new HashSet<Class>();
if ( superClass != null ) {
key.add( superClass );
}
if ( interfaces != null && interfaces.length > 0 ) {
key.addAll( Arrays.asList( interfaces ) );
}
this.proxyClass = bytebuddy.getCurrentyByteBuddy() this.proxyClass = bytebuddy.getCurrentyByteBuddy()
.with( new NamingStrategy.SuffixingRandom( PROXY_NAMING_SUFFIX, new NamingStrategy.SuffixingRandom.BaseNameResolver.ForFixedValue( superClassOrMainInterface.getName() ) ) ) .with( new NamingStrategy.SuffixingRandom( PROXY_NAMING_SUFFIX, new NamingStrategy.SuffixingRandom.BaseNameResolver.ForFixedValue( superClassOrMainInterface.getName() ) ) )

View File

@ -1131,8 +1131,6 @@ public class ActionQueue {
// the mapping of entity names to their latest batch numbers. // the mapping of entity names to their latest batch numbers.
private List<BatchIdentifier> latestBatches; private List<BatchIdentifier> latestBatches;
private Map<Object, BatchIdentifier> entityBatchIdentifier;
// the map of batch numbers to EntityInsertAction lists // the map of batch numbers to EntityInsertAction lists
private Map<BatchIdentifier, List<AbstractEntityInsertAction>> actionBatches; private Map<BatchIdentifier, List<AbstractEntityInsertAction>> actionBatches;
@ -1145,7 +1143,6 @@ public class ActionQueue {
public void sort(List<AbstractEntityInsertAction> insertions) { public void sort(List<AbstractEntityInsertAction> insertions) {
// optimize the hash size to eliminate a rehash. // optimize the hash size to eliminate a rehash.
this.latestBatches = new ArrayList<>( ); this.latestBatches = new ArrayList<>( );
this.entityBatchIdentifier = new HashMap<>( insertions.size() + 1, 1.0f );
this.actionBatches = new HashMap<>(); this.actionBatches = new HashMap<>();
for ( AbstractEntityInsertAction action : insertions ) { for ( AbstractEntityInsertAction action : insertions ) {
@ -1169,7 +1166,6 @@ public class ActionQueue {
latestBatches.add( batchIdentifier ); latestBatches.add( batchIdentifier );
} }
addParentChildEntityNames( action, batchIdentifier ); addParentChildEntityNames( action, batchIdentifier );
entityBatchIdentifier.put( currentEntity, batchIdentifier );
addToBatch( batchIdentifier, action ); addToBatch( batchIdentifier, action );
} }
insertions.clear(); insertions.clear();