Skip to content

Commit

Permalink
HHH-11067 : Fix to work with JDK6 souce
Browse files Browse the repository at this point in the history
  • Loading branch information
gbadner committed Sep 15, 2016
1 parent a53e3ed commit df2432d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit df2432d

Please sign in to comment.