mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-02 07:49:23 +00:00
HHH-11067 : Fix to work with JDK6 souce
(cherry picked from commit df2432d68426a40c0e2ef8d8412b8a90820096c5)
This commit is contained in:
parent
4c04d35b4c
commit
4a2993211b
@ -297,17 +297,18 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
|
||||
final String methodName = method.getName();
|
||||
|
||||
// first check methods calls that we handle completely locally:
|
||||
if ( "equals".equals( methodName ) && method.getParameterCount() == 1 ) {
|
||||
final int parameterCount = method.getParameterTypes().length;
|
||||
if ( "equals".equals( methodName ) && parameterCount == 1 ) {
|
||||
if ( args[0] == null
|
||||
|| !Proxy.isProxyClass( args[0].getClass() ) ) {
|
||||
return false;
|
||||
}
|
||||
return this.equals( Proxy.getInvocationHandler( args[0] ) );
|
||||
}
|
||||
else if ( "hashCode".equals( methodName ) && method.getParameterCount() == 0 ) {
|
||||
else if ( "hashCode".equals( methodName ) && parameterCount == 0 ) {
|
||||
return this.hashCode();
|
||||
}
|
||||
else if ( "toString".equals( methodName ) && method.getParameterCount() == 0 ) {
|
||||
else if ( "toString".equals( methodName ) && parameterCount == 0 ) {
|
||||
return String.format( Locale.ROOT, "ThreadLocalSessionContext.TransactionProtectionWrapper[%s]", realSession );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user