From e1aa8714c054a1791d6293e623f8cdc09ac7a483 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Sun, 5 Apr 2020 22:55:22 +0100 Subject: [PATCH] HHH-13930 Minor formatting improvements and comments --- .../internal/bytebuddy/ByteBuddyState.java | 2 +- .../pojo/bytebuddy/ByteBuddyProxyHelper.java | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/ByteBuddyState.java b/hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/ByteBuddyState.java index 76f4e27e78..97f768d4c4 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/ByteBuddyState.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/internal/bytebuddy/ByteBuddyState.java @@ -182,7 +182,7 @@ public final class ByteBuddyState { } public Unloaded make(Function> makeProxyFunction) { - return make(makeProxyFunction.apply( byteBuddy )); + return make( makeProxyFunction.apply( byteBuddy ) ); } private Unloaded make(DynamicType.Builder builder) { diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java index e4fa59a686..dc66871460 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyHelper.java @@ -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> key = new HashSet>(); if ( interfaces.length == 1 ) { key.add( persistentClass ); } key.addAll( Arrays.>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> proxyBuilder( - Class persistentClass, - Class[] interfaces - ) { + private Function> 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() ) ) )