[ofbiz-framework] branch release17.12 updated: Fixed: Bypass Java GString to String conversion in ObjectType::simpleTypeOrObjectConvert (OFBIZ-12182)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release17.12 updated: Fixed: Bypass Java GString to String conversion in ObjectType::simpleTypeOrObjectConvert (OFBIZ-12182)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release17.12 by this push:
     new a0b2f55  Fixed: Bypass Java GString to String conversion in ObjectType::simpleTypeOrObjectConvert (OFBIZ-12182)
a0b2f55 is described below

commit a0b2f55b40b462057ed3882d4ca2e43af74257ef
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Fri Feb 19 09:28:53 2021 +0100

    Fixed: Bypass Java GString to String conversion in ObjectType::simpleTypeOrObjectConvert (OFBIZ-12182)
   
    Follows https://markmail.org/message/azn7e4g2rbpo7tvj
   
    Conflicts handled by hand
     framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
---
 .../base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
index 8afad2f..644dd52 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
@@ -508,13 +508,12 @@ public class ObjectType {
         if (obj == null || UtilValidate.isEmpty(type) || "Object".equals(type) || "java.lang.Object".equals(type)) {
             return obj;
         }
-        if ("PlainString".equals(type)) {
+        if ("PlainString".equals(type)
+                || ("org.codehaus.groovy.runtime.GStringImpl".equals(obj.getClass().getName()) && "String".equals(type))) {
             return obj.toString();
         }
         if (obj instanceof Node) {
             Node node = (Node) obj;
-
-
             String nodeValue =  node.getTextContent();
 
             if (nodeValue == null) {