myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject svn commit: r1813409 - in /myfaces/core/branches/2.3.x: impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java shared-public/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java
Date Thu, 26 Oct 2017 14:28:35 GMT
Author: tandraschko
Date: Thu Oct 26 14:28:35 2017
New Revision: 1813409

URL: http://svn.apache.org/viewvc?rev=1813409&view=rev
Log:
MYFACES-4167 MyFaces doesn't validate composite:attribute type class

Modified:
    myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java
    myfaces/core/branches/2.3.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java

Modified: myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java?rev=1813409&r1=1813408&r2=1813409&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java
(original)
+++ myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java
Thu Oct 26 14:28:35 2017
@@ -328,9 +328,10 @@ public class AttributeHandler extends Ta
             {
                 if (_type != null)
                 {
-                    String type = _type.getValue(ctx);
                     Class clazz = String.class;
-                    if (type != null)
+                    
+                    String type = _type.getValue(ctx);
+                    if (type != null && !type.trim().isEmpty())
                     {
                         try
                         {
@@ -338,7 +339,9 @@ public class AttributeHandler extends Ta
                         }
                         catch (ClassNotFoundException e)
                         {
-                            //Assume String
+                            log.log(Level.WARNING,
+                                    "composite:attribute 'type' with value'" + type + "'
not resolveable. Fallback to string.",
+                                    e);
                         }
                     }
                     

Modified: myfaces/core/branches/2.3.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java?rev=1813409&r1=1813408&r2=1813409&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java
(original)
+++ myfaces/core/branches/2.3.x/shared-public/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java
Thu Oct 26 14:28:35 2017
@@ -164,9 +164,7 @@ public final class ClassUtils
         // the local variable stack, that way
         //we can avoid synchronisation calls
         ClassLoaderExtension [] loaderPlugins = classLoadingExtensions;
-
-        int plugins = loaderPlugins.length;
-        for(int cnt = 0; cnt < loaderPlugins.length; cnt ++)
+        for (int cnt = 0; cnt < loaderPlugins.length; cnt ++)
         {
             ClassLoaderExtension extension = loaderPlugins[cnt];
             Class retVal = extension.forName(type);
@@ -176,7 +174,6 @@ public final class ClassUtils
             }
         }
 
-
         if (type == null)
         {
             throw new NullPointerException("type");



Mime
View raw message