Author: markt
Date: Tue Jun 25 19:05:50 2013
New Revision: 1496592
URL: http://svn.apache.org/r1496592
Log:
Parameters using decoders can't use partial messages
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties
tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties?rev=1496592&r1=1496591&r2=1496592&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties
Tue Jun 25 19:05:50 2013
@@ -28,6 +28,7 @@ pojoMethodMapping.invalidDecoder=The spe
pojoMethodMapping.noPayload=No payload parameter present on the method [{0}]
of class [{1}] that was annotated with OnMessage
pojoMethodMapping.onErrorNoThrowable=No Throwable parameter was present on the
method [{0}] of class [{1}] that was annotated with OnError
pojoMethodMapping.partialInputStream=Invalid InputStream and boolean
parameters present on the method [{0}] of class [{1}] that was annotated with
OnMessage
+pojoMethodMapping.partialObject=Invalid Object and boolean parameters present
on the method [{0}] of class [{1}] that was annotated with OnMessage
pojoMethodMapping.partialPong=Invalid PongMesssge and boolean parameters
present on the method [{0}] of class [{1}] that was annotated with OnMessage
pojoMethodMapping.partialReader=Invalid Reader and boolean parameters present
on the method [{0}] of class [{1}] that was annotated with OnMessage
pojoMethodMapping.pongWithPayload=Invalid PongMessgae and Message parameters
present on the method [{0}] of class [{1}] that was annotated with OnMessage
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1496592&r1=1496591&r2=1496592&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
Tue Jun 25 19:05:50 2013
@@ -300,6 +300,7 @@ public class PojoMethodMapping {
Class<?>[] types = m.getParameterTypes();
Annotation[][] paramsAnnotations = m.getParameterAnnotations();
+ boolean decoderParameterFound = false;
for (int i = 0; i < types.length; i++) {
boolean paramFound = false;
@@ -403,6 +404,7 @@ public class PojoMethodMapping {
if (indexByteBuffer == -1) {
indexByteBuffer = i;
foundBinaryDecoderMatch = true;
+ decoderParameterFound = true;
} else {
throw new
IllegalArgumentException(sm.getString(
"pojoMethodMapping.duplicateMessageParam",
@@ -414,6 +416,7 @@ public class PojoMethodMapping {
if (indexString == -1) {
indexString = i;
foundTextDecoderMatch = true;
+ decoderParameterFound = true;
} else {
throw new
IllegalArgumentException(sm.getString(
"pojoMethodMapping.duplicateMessageParam",
@@ -510,6 +513,11 @@ public class PojoMethodMapping {
"pojoMethodMapping.partialInputStream",
m.getName(), m.getDeclaringClass().getName()));
}
+ if (decoderParameterFound && indexBoolean != -1) {
+ throw new IllegalArgumentException(sm.getString(
+ "pojoMethodMapping.partialObject",
+ m.getName(), m.getDeclaringClass().getName()));
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]