Author: markt
Date: Wed Jan 30 12:28:05 2019
New Revision: 1852519
URL: http://svn.apache.org/viewvc?rev=1852519&view=rev
Log:
Fix handling of POJOs with synthetic methods.
Issue found while testing with nightly build of Jakarta EE WebSocket TCK.
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
tomcat/trunk/webapps/docs/changelog.xml
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=1852519&r1=1852518&r2=1852519&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
Wed Jan 30 12:28:05 2019
@@ -88,6 +88,13 @@ public class PojoMethodMapping {
clazzPojoMethods = currentClazzMethods;
}
for (Method method : currentClazzMethods) {
+ if (method.isSynthetic()) {
+ // Skip all synthetic methods.
+ // They may have copies of annotations from methods we are
+ // interested in and they will use the wrong parameter type
+ // (they always use Object) so we can't used them here.
+ continue;
+ }
if (method.getAnnotation(OnOpen.class) != null) {
checkPublic(method);
if (open == null) {
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1852519&r1=1852518&r2=1852519&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jan 30 12:28:05 2019
@@ -198,6 +198,9 @@
Ensure that the network connection is closed if the client receives an
I/O error trying to communicate with the server. (markt)
</fix>
+ <fix>
+ Ignore synthetic methods when scanning POJO methods. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Web applications">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]