From 6e72e79d0c04fbfe725b38eb500b818c037c8439 Mon Sep 17 00:00:00 2001 From: nathan Date: Sun, 6 Mar 2016 23:51:59 +0100 Subject: [PATCH] code polish --- .../network/rmi/RemoteObjectInvocationHandler.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dorkbox/network/rmi/RemoteObjectInvocationHandler.java b/src/dorkbox/network/rmi/RemoteObjectInvocationHandler.java index 0f037eec..2aa0986c 100644 --- a/src/dorkbox/network/rmi/RemoteObjectInvocationHandler.java +++ b/src/dorkbox/network/rmi/RemoteObjectInvocationHandler.java @@ -38,7 +38,7 @@ package dorkbox.network.rmi; import dorkbox.network.connection.Connection; import dorkbox.network.connection.EndPoint; import dorkbox.network.connection.ListenerRaw; -import dorkbox.network.util.CryptoSerializationManager; +import dorkbox.network.util.RMISerializationManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -127,6 +127,8 @@ class RemoteObjectInvocationHandler implements InvocationHandler { .add(this.responseListener); } + + @SuppressWarnings({"AutoUnboxing", "AutoBoxing", "NumericCastThatLosesPrecision", "IfCanBeSwitch"}) @Override public @@ -205,7 +207,7 @@ class RemoteObjectInvocationHandler implements InvocationHandler { final Logger logger1 = RemoteObjectInvocationHandler.logger; EndPoint endPoint = this.connection.getEndPoint(); - final CryptoSerializationManager serializationManager = endPoint.getSerialization(); + final RMISerializationManager serializationManager = endPoint.getSerialization(); InvokeMethod invokeMethod = new InvokeMethod(); invokeMethod.objectID = this.objectID; @@ -213,7 +215,8 @@ class RemoteObjectInvocationHandler implements InvocationHandler { // which method do we access? - CachedMethod[] cachedMethods = CachedMethod.getMethods(serializationManager.getKryo(), method.getDeclaringClass()); + CachedMethod[] cachedMethods = CachedMethod.getMethods(serializationManager, method.getDeclaringClass()); + for (int i = 0, n = cachedMethods.length; i < n; i++) { CachedMethod cachedMethod = cachedMethods[i]; Method checkMethod = cachedMethod.origMethod; @@ -242,6 +245,7 @@ class RemoteObjectInvocationHandler implements InvocationHandler { break; } } + if (invokeMethod.cachedMethod == null) { String msg = "Method not found: " + method; logger1.error(msg);