You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/01/20 06:01:43 UTC

[incubator-servicecomb-java-chassis] 04/10: SCB-266 if a class no fields defined, then it's not a RPC wrapper class

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 8ef2ce9228e6ba027d98675b405493e552c96ef2
Author: wujimin <wu...@huawei.com>
AuthorDate: Sat Jan 20 01:59:53 2018 +0800

    SCB-266 if a class no fields defined, then it's not a RPC wrapper class
---
 .../swagger/invocation/arguments/ArgumentsMapperFactory.java         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/arguments/ArgumentsMapperFactory.java b/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/arguments/ArgumentsMapperFactory.java
index 454bc27..8e4f183 100644
--- a/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/arguments/ArgumentsMapperFactory.java
+++ b/swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/arguments/ArgumentsMapperFactory.java
@@ -99,6 +99,11 @@ public abstract class ArgumentsMapperFactory {
       return false;
     }
 
+    // no public field, it's not rpc wrapper class
+    if (((Class<?>) swaggerType).getFields().length == 0) {
+      return false;
+    }
+
     swaggerType = ((Class<?>) swaggerType).getFields()[0].getGenericType();
     Converter converter = converterMgr.findConverter(type, firstProviderParam, swaggerType);
     if (ConverterCommon.class.isInstance(converter)) {

-- 
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.