HHH-13930 Minor formatting improvements and comments

This commit is contained in:
Sanne Grinovero 2020-04-05 22:55:22 +01:00
parent 0955394c82
commit e1aa8714c0
2 changed files with 8 additions and 12 deletions

View File

@ -182,7 +182,7 @@ public final class ByteBuddyState {
}
public Unloaded<?> make(Function<ByteBuddy, DynamicType.Builder<?>> makeProxyFunction) {
return make(makeProxyFunction.apply( byteBuddy ));
return make( makeProxyFunction.apply( byteBuddy ) );
}
private Unloaded<?> make(DynamicType.Builder<?> builder) {

View File

@ -45,29 +45,25 @@ public class ByteBuddyProxyHelper implements Serializable {
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public Class buildProxy(
final Class persistentClass,
final Class[] interfaces) {
public Class buildProxy(final Class persistentClass, final Class[] interfaces) {
Set<Class<?>> key = new HashSet<Class<?>>();
if ( interfaces.length == 1 ) {
key.add( persistentClass );
}
key.addAll( Arrays.<Class<?>>asList( interfaces ) );
return byteBuddyState.loadProxy( persistentClass, new TypeCache.SimpleKey(key), proxyBuilder(persistentClass, interfaces) );
return byteBuddyState.loadProxy( persistentClass, new TypeCache.SimpleKey( key ), proxyBuilder( persistentClass, interfaces ) );
}
/**
* Do not remove: used by Quarkus
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public DynamicType.Unloaded<?> buildUnloadedProxy(
final Class persistentClass,
final Class[] interfaces) {
public DynamicType.Unloaded<?> buildUnloadedProxy(final Class persistentClass, final Class[] interfaces) {
return byteBuddyState.make( proxyBuilder( persistentClass, interfaces ) );
}
private Function<ByteBuddy, DynamicType.Builder<?>> proxyBuilder(
Class persistentClass,
Class[] interfaces
) {
private Function<ByteBuddy, DynamicType.Builder<?>> proxyBuilder(Class persistentClass, Class[] interfaces) {
return byteBuddy -> byteBuddy
.ignore( byteBuddyState.getProxyDefinitionHelpers().getGroovyGetMetaClassFilter() )
.with( new NamingStrategy.SuffixingRandom( PROXY_NAMING_SUFFIX, new NamingStrategy.SuffixingRandom.BaseNameResolver.ForFixedValue( persistentClass.getName() ) ) )