myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r908388 - /myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorage.java
Date Wed, 10 Feb 2010 08:42:20 GMT
Author: gpetracek
Date: Wed Feb 10 08:42:20 2010
New Revision: 908388

URL: http://svn.apache.org/viewvc?rev=908388&view=rev
Log:
cglib aware meta-data storage

Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorage.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorage.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorage.java?rev=908388&r1=908387&r2=908388&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorage.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultMetaDataStorage.java
Wed Feb 10 08:42:20 2010
@@ -184,7 +184,18 @@
 
     private String createKey(Class targetClass, String targetProperty)
     {
-        return targetClass.getName() + "#" + targetProperty;
+        String targetClassName = getTargetClassName(targetClass);
+        return targetClassName + "#" + targetProperty;
+    }
+
+    private String getTargetClassName(Class currentClass)
+    {
+        if (currentClass.getName().contains("$$EnhancerByCGLIB$$")
+            || currentClass.getName().contains("$$FastClassByCGLIB$$"))
+        {
+            return currentClass.getName().substring(0, currentClass.getName().indexOf("$"));
+        }
+        return currentClass.getName();
     }
 
     @ToDo(Priority.MEDIUM)



Mime
View raw message