Skip to content

Commit

Permalink
Removed deprecated methods in ProxyFactoryFactory and NoneBasicProxyF…
Browse files Browse the repository at this point in the history
…actory

Signed-off-by: Jan Schatteman <[email protected]>
  • Loading branch information
jrenaat authored and sebersole committed Mar 9, 2022
1 parent 9fc2b3d commit 291e755
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.hibernate.bytecode.internal.bytebuddy;

import org.hibernate.AssertionFailure;
import org.hibernate.bytecode.spi.BasicProxyFactory;
import org.hibernate.bytecode.spi.ProxyFactoryFactory;
import org.hibernate.engine.spi.SessionFactoryImplementor;
Expand All @@ -30,21 +29,6 @@ public ProxyFactory buildProxyFactory(SessionFactoryImplementor sessionFactory)
return new ByteBuddyProxyFactory( byteBuddyProxyHelper );
}

@Override
@Deprecated
public BasicProxyFactory buildBasicProxyFactory(Class superClass, Class[] interfaces) {
if ( superClass == null && ( interfaces == null || interfaces.length == 0 ) ) {
throw new AssertionFailure( "Attempting to build proxy without any superclass or interfaces" );
}
if ( superClass != null && ( interfaces != null && interfaces.length > 0 ) ) {
throw new AssertionFailure( "Ambiguous call: this method can only be invoked with either a superClass or interfaces, not both" );
}
if ( interfaces != null && interfaces.length > 1 ) {
throw new AssertionFailure( "Ambiguous call: this method can only accept a single interfaces, not multiple in the array (legacy expectation)" );
}
return buildBasicProxyFactory( superClass == null ? interfaces[0] : superClass );
}

public BasicProxyFactory buildBasicProxyFactory(Class superClassOrInterface) {
if ( superClassOrInterface.isInterface() ) {
return new BasicProxyFactoryImpl( null, superClassOrInterface, byteBuddyState );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.proxy.ProxyFactory;


/**
* When entities are enhanced in advance, proxies are not needed.
*/
Expand All @@ -22,11 +21,6 @@ public ProxyFactory buildProxyFactory(SessionFactoryImplementor sessionFactory)
return DisallowedProxyFactory.INSTANCE;
}

@Override
public BasicProxyFactory buildBasicProxyFactory(Class superClass, Class[] interfaces) {
return new NoneBasicProxyFactory( superClass, interfaces );
}

@Override
public BasicProxyFactory buildBasicProxyFactory(Class superClassOrInterface) {
return new NoneBasicProxyFactory( superClassOrInterface );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.hibernate.bytecode.internal.none;

import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
import org.hibernate.bytecode.spi.BasicProxyFactory;

Expand All @@ -17,20 +16,6 @@ final class NoneBasicProxyFactory implements BasicProxyFactory {

private final Class superClassOrInterface;

@Deprecated
public NoneBasicProxyFactory(Class superClass, Class[] interfaces) {
if ( superClass == null && ( interfaces == null || interfaces.length == 0 ) ) {
throw new AssertionFailure( "Attempting to build proxy without any superclass or interfaces" );
}
if ( superClass != null && ( interfaces != null && interfaces.length > 0 ) ) {
throw new AssertionFailure( "Ambiguous call: this method can only be invoked with either a superClass or interfaces, not both" );
}
if ( interfaces != null && interfaces.length > 1 ) {
throw new AssertionFailure( "Ambiguous call: this method can only accept a single interface, not multiple in the array (legacy expectation now being enforced)" );
}
this.superClassOrInterface = superClass != null ? superClass : interfaces[0];
}

public NoneBasicProxyFactory(Class superClassOrInterface) {
this.superClassOrInterface = superClassOrInterface;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ public interface ProxyFactoryFactory extends Service {
*/
ProxyFactory buildProxyFactory(SessionFactoryImplementor sessionFactory);

/**
* Build a proxy factory for basic proxy concerns. The return
* should be capable of properly handling newInstance() calls.
* <p/>
* Should build basic proxies essentially equivalent to JDK proxies in
* terms of capabilities, but should be able to deal with abstract super
* classes in addition to proxy interfaces.
* <p/>
* Must pass in either superClass or interfaces (or both).
*
* @param superClass The abstract super class (or null if none).
* @param interfaces Interfaces to be proxied (or null if none).
* @deprecated Use {@link #buildBasicProxyFactory(Class)} instead.
* @return The proxy class
*/
@Deprecated
BasicProxyFactory buildBasicProxyFactory(Class superClass, Class[] interfaces);

/**
* Build a proxy factory for basic proxy concerns. The return
* should be capable of properly handling newInstance() calls.
Expand Down

0 comments on commit 291e755

Please sign in to comment.