[jira] [Commented] (SCB-946) serialize/deseriaze List>/List>/Map>/Map>

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16714645#comment-16714645
 ] 

ASF GitHub Bot commented on SCB-946:


liubao68 closed pull request #1025: [SCB-946] serialize/deseriaze 
List>/List>/Map>/Map>
URL: https://github.com/apache/servicecomb-java-chassis/pull/1025
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/ProtoMapper.java
 
b/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/ProtoMapper.java
index 860a9f6f0..0af2afb88 100644
--- 
a/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/ProtoMapper.java
+++ 
b/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/ProtoMapper.java
@@ -20,7 +20,9 @@
 import java.util.Map;
 
 import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
+import 
org.apache.servicecomb.foundation.protobuf.internal.RootPropertyWrapDeserializer;
 import 
org.apache.servicecomb.foundation.protobuf.internal.bean.BeanDescriptorManager;
+import 
org.apache.servicecomb.foundation.protobuf.internal.bean.PropertyWrapper;
 import 
org.apache.servicecomb.foundation.protobuf.internal.schema.deserializer.DeserializerSchemaManager;
 import 
org.apache.servicecomb.foundation.protobuf.internal.schema.serializer.SerializerSchemaManager;
 
@@ -105,4 +107,17 @@ public RootDeserializer createRootDeserializer(JavaType 
javaType, String shortMe
   public RootDeserializer createRootDeserializer(JavaType javaType, Message 
message) {
 return deserializerSchemaManager.createRootDeserializer(javaType, message);
   }
+
+  public RootDeserializer createPropertyRootDeserializer(String 
shortWrapMessageName, Type propertyType) {
+Message message = proto.getMessage(shortWrapMessageName);
+if (!deserializerSchemaManager.isWrapProperty(message)) {
+  return createRootDeserializer(propertyType, shortWrapMessageName);
+}
+
+JavaType propertyWrapJavaType = 
TypeFactory.defaultInstance().constructParametricType(
+PropertyWrapper.class,
+TypeFactory.defaultInstance().constructType(propertyType));
+RootDeserializer rootDeserializer = 
createRootDeserializer(propertyWrapJavaType, message);
+return new RootPropertyWrapDeserializer(rootDeserializer);
+  }
 }
diff --git 
a/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/ProtoConst.java
 
b/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/ProtoConst.java
index 53ec0c2f6..72f376490 100644
--- 
a/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/ProtoConst.java
+++ 
b/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/ProtoConst.java
@@ -30,6 +30,8 @@
   private ProtoConst() {
   }
 
+  public static String ANNOTATION_WRAP_PROPERTY = "@WrapProperty";
+
   public static String OP_HINT = " scb:";
 
   public static String PACK_SCHEMA = "type.googleapis.com/";
diff --git 
a/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/RootPropertyWrapDeserializer.java
 
b/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/RootPropertyWrapDeserializer.java
new file mode 100644
index 0..ab646993e
--- /dev/null
+++ 
b/foundations/foundation-protobuf/src/main/java/org/apache/servicecomb/foundation/protobuf/internal/RootPropertyWrapDeserializer.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.foundation.protobuf.internal;
+
+import java.io.IOException;
+
+import org.apache.servicecomb.foundation.protobuf.RootDeserializer;
+import 
org.apache.servicecomb.fou

[jira] [Commented] (SCB-946) serialize/deseriaze List>/List>/Map>/Map>

2018-12-07 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16713481#comment-16713481
 ] 

ASF GitHub Bot commented on SCB-946:


coveralls edited a comment on issue #1025: [SCB-946] serialize/deseriaze 
List>/List>/Map>/Map>
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1025#issuecomment-445420486
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/20472107/badge)](https://coveralls.io/builds/20472107)
   
   Coverage decreased (-0.04%) to 86.706% when pulling 
**9206dea1ea4973f39a22b27803100cfbcf234911 on 
wujimin:enhance-protobuf-codec-of-list-map** into 
**374f5e21c3a6b960242fc68b5bfe391498aac6da on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> serialize/deseriaze List>/List>/Map>/Map Map>
> ---
>
> Key: SCB-946
> URL: https://issues.apache.org/jira/browse/SCB-946
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
> Fix For: java-chassis-1.2.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-946) serialize/deseriaze List>/List>/Map>/Map>

2018-12-07 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16713475#comment-16713475
 ] 

ASF GitHub Bot commented on SCB-946:


coveralls commented on issue #1025: [SCB-946] serialize/deseriaze 
List>/List>/Map>/Map>
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1025#issuecomment-445420486
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/20467983/badge)](https://coveralls.io/builds/20467983)
   
   Coverage decreased (-0.03%) to 86.709% when pulling 
**5b095e46b4ef4da82263149d1b2a50e8feea85fc on 
wujimin:enhance-protobuf-codec-of-list-map** into 
**374f5e21c3a6b960242fc68b5bfe391498aac6da on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> serialize/deseriaze List>/List>/Map>/Map Map>
> ---
>
> Key: SCB-946
> URL: https://issues.apache.org/jira/browse/SCB-946
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
> Fix For: java-chassis-1.2.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-946) serialize/deseriaze List>/List>/Map>/Map>

2018-12-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16710136#comment-16710136
 ] 

ASF GitHub Bot commented on SCB-946:


wujimin opened a new pull request #1025: [SCB-946] serialize/deseriaze 
List>/List>/Map>/Map>
URL: https://github.com/apache/servicecomb-java-chassis/pull/1025
 
 
   protobuf idl can not describe List>/List>/Map>/Map>
   wrap them to standard proto message when serialize
   and unwrap when deserialize


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> serialize/deseriaze List>/List>/Map>/Map Map>
> ---
>
> Key: SCB-946
> URL: https://issues.apache.org/jira/browse/SCB-946
> Project: Apache ServiceComb
>  Issue Type: Sub-task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
> Fix For: java-chassis-1.2.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)