struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [03/28] struts git commit: change findBaseAccessor method
Date Thu, 19 Mar 2015 08:50:02 GMT
change findBaseAccessor method

in hibernate4.3.7,because javassist3.18.1's class name generate rule is '_$$_jvst'+...

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/b8882758
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/b8882758
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/b8882758

Branch: refs/heads/master
Commit: b8882758036a1abe86c5405889410c55da958a80
Parents: 2433789
Author: aronshen <ss.q@qq.com>
Authored: Tue Jan 20 11:54:10 2015 +0800
Committer: aronshen <ss.q@qq.com>
Committed: Tue Jan 20 11:54:10 2015 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/struts2/json/JSONWriter.java  | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/b8882758/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java
----------------------------------------------------------------------
diff --git a/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java b/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java
index fd9b844..dc53967 100644
--- a/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java
+++ b/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java
@@ -305,7 +305,18 @@ public class JSONWriter {
             } catch (Exception ex) {
                 LOG.debug(ex.getMessage(), ex);
             }
-        } else {
+            
+        //in hibernate4.3.7,because javassist3.18.1's class name generate rule is '_$$_jvst'+...
+        } else if(clazz.getName().contains("$$_jvst")){
+            try {
+                baseAccessor = Class.forName(
+                        clazz.getName().substring(0, clazz.getName().indexOf("_$$")))
+                        .getMethod(accessor.getName(), accessor.getParameterTypes());
+            } catch (Exception ex) {
+                LOG.debug(ex.getMessage(), ex);
+            }
+        }
+        else {
             return accessor;
         }
         return baseAccessor;


Mime
View raw message