myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: refactored
Date Mon, 03 Dec 2018 11:53:47 GMT
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new d657a1b  refactored
d657a1b is described below

commit d657a1bce169f7df342f46538d19db7a64721947
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Mon Dec 3 12:53:41 2018 +0100

    refactored
---
 .../application/ApplicationFactoryImpl.java        |  7 ++-
 .../myfaces/application/ResourceHandlerImpl.java   | 19 +++----
 .../search/CompositeSearchKeywordResolver.java     | 16 ++----
 .../myfaces/component/visit/FullVisitContext.java  |  6 +--
 .../component/visit/PartialVisitContext.java       |  6 +--
 .../org/apache/myfaces/config/RuntimeConfig.java   | 27 ++--------
 .../myfaces/context/AjaxExceptionHandlerImpl.java  | 16 +++---
 .../myfaces/context/ExceptionHandlerImpl.java      | 18 +++----
 .../myfaces/context/servlet/FacesContextImpl.java  | 14 ++---
 .../myfaces/util/ParametrizableFacesMessage.java   | 17 +++---
 .../view/facelets/AbstractFaceletCache.java        |  7 ++-
 .../myfaces/view/facelets/compiler/UILeaf.java     | 61 +++-------------------
 .../myfaces/view/facelets/component/UIRepeat.java  | 16 +++---
 .../view/facelets/el/DefaultFunctionMapper.java    | 23 ++------
 14 files changed, 71 insertions(+), 182 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java
b/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java
index f62abd9..51153f2 100755
--- a/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java
@@ -25,6 +25,7 @@ import javax.faces.application.Application;
 import javax.faces.application.ApplicationFactory;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
+import org.apache.myfaces.util.Assert;
 
 /**
  * @author Manfred Geiler (latest modification by $Author$)
@@ -81,10 +82,8 @@ public class ApplicationFactoryImpl extends ApplicationFactory
     @Override
     public void setApplication(Application application)
     {
-        if (application == null)
-        {
-            throw new NullPointerException("Cannot set a null application in the ApplicationFactory");
-        }
+        Assert.notNull(application, "application");
+        
         _application = application;
         putApplicationOnMap();
     }
diff --git a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
index 8ed5a15..8c89ab8 100644
--- a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
@@ -65,6 +65,7 @@ import org.apache.myfaces.util.SharedStringBuilder;
 import org.apache.myfaces.resource.ContractResource;
 import org.apache.myfaces.resource.ContractResourceLoader;
 import org.apache.myfaces.resource.ResourceCachedInfo;
+import org.apache.myfaces.util.Assert;
 import org.apache.myfaces.util.SkipMatchIterator;
 
 /**
@@ -135,13 +136,10 @@ public class ResourceHandlerImpl extends ResourceHandler
     public Resource createResource(String resourceName, String libraryName,
             String contentType)
     {
+        Assert.notNull(resourceName, "resourceName");
+        
         Resource resource = null;
         
-        if (resourceName == null) 
-        {
-            throw new NullPointerException();
-        }
-
         if (resourceName.length() == 0)
         {
             return null;
@@ -1024,10 +1022,7 @@ public class ResourceHandlerImpl extends ResourceHandler
     {
         Resource resource = null;
 
-        if (resourceId == null)
-        {
-            throw new NullPointerException();
-        }
+        Assert.notNull(resourceId, "resourceId");
         
         // Later in deriveResourceMeta the resourceId is decomposed and
         // its elements validated properly.
@@ -1621,10 +1616,8 @@ public class ResourceHandlerImpl extends ResourceHandler
         
         Resource resource = null;
 
-        if (resourceName == null)
-        {
-            throw new NullPointerException();
-        }
+        Assert.notNull(resourceName, "resourceName");
+        
         if (resourceName.charAt(0) == '/')
         {
             // If resourceName starts with '/', remove that character because it
diff --git a/impl/src/main/java/org/apache/myfaces/component/search/CompositeSearchKeywordResolver.java
b/impl/src/main/java/org/apache/myfaces/component/search/CompositeSearchKeywordResolver.java
index 526c262..a8cb567 100644
--- a/impl/src/main/java/org/apache/myfaces/component/search/CompositeSearchKeywordResolver.java
+++ b/impl/src/main/java/org/apache/myfaces/component/search/CompositeSearchKeywordResolver.java
@@ -23,14 +23,11 @@ import javax.faces.component.UIComponent;
 import javax.faces.component.search.SearchExpressionContext;
 import javax.faces.component.search.SearchKeywordContext;
 import javax.faces.component.search.SearchKeywordResolver;
+import org.apache.myfaces.util.Assert;
 
-/**
- *
- */
 public class CompositeSearchKeywordResolver extends SearchKeywordResolver
 {
     private int size;
-
     private SearchKeywordResolver[] resolvers;
 
     public CompositeSearchKeywordResolver()
@@ -39,20 +36,17 @@ public class CompositeSearchKeywordResolver extends SearchKeywordResolver
         this.resolvers = new SearchKeywordResolver[2];
     }
 
-    public void add(SearchKeywordResolver elResolver)
+    public void add(SearchKeywordResolver keywordResolver)
     {
-        if (elResolver == null)
-        {
-            throw new NullPointerException();
-        }
-
+        Assert.notNull(keywordResolver, "keywordResolver");
+        
         if (this.size >= this.resolvers.length)
         {
             SearchKeywordResolver[] nr = new SearchKeywordResolver[this.size * 2];
             System.arraycopy(this.resolvers, 0, nr, 0, this.size);
             this.resolvers = nr;
         }
-        this.resolvers[this.size++] = elResolver;
+        this.resolvers[this.size++] = keywordResolver;
     }
 
     @Override
diff --git a/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java b/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java
index 4f8726a..0005c0c 100644
--- a/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java
+++ b/impl/src/main/java/org/apache/myfaces/component/visit/FullVisitContext.java
@@ -30,6 +30,7 @@ import javax.faces.component.visit.VisitContext;
 import javax.faces.component.visit.VisitHint;
 import javax.faces.component.visit.VisitResult;
 import javax.faces.context.FacesContext;
+import org.apache.myfaces.util.Assert;
 
 /**
  * <p>
@@ -70,10 +71,7 @@ public class FullVisitContext extends VisitContext
      */
     public FullVisitContext(FacesContext facesContext, Set<VisitHint> hints)
     {
-        if (facesContext == null)
-        {
-            throw new NullPointerException();
-        }
+        Assert.notNull(facesContext, "facesContext");
 
         _facesContext = facesContext;
 
diff --git a/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
b/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
index de1df3d..0d35105 100644
--- a/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
+++ b/impl/src/main/java/org/apache/myfaces/component/visit/PartialVisitContext.java
@@ -36,6 +36,7 @@ import javax.faces.component.visit.VisitContext;
 import javax.faces.component.visit.VisitHint;
 import javax.faces.component.visit.VisitResult;
 import javax.faces.context.FacesContext;
+import org.apache.myfaces.util.Assert;
 
 /**
  * <p>
@@ -93,10 +94,7 @@ public class PartialVisitContext extends VisitContext
      */
     public PartialVisitContext(FacesContext facesContext, Collection<String> clientIds,
Set<VisitHint> hints)
     {
-        if (facesContext == null)
-        {
-            throw new NullPointerException();
-        }
+        Assert.notNull(facesContext, "facesContext");
 
         _facesContext = facesContext;
 
diff --git a/impl/src/main/java/org/apache/myfaces/config/RuntimeConfig.java b/impl/src/main/java/org/apache/myfaces/config/RuntimeConfig.java
index 1f21c0f..209240c 100755
--- a/impl/src/main/java/org/apache/myfaces/config/RuntimeConfig.java
+++ b/impl/src/main/java/org/apache/myfaces/config/RuntimeConfig.java
@@ -44,6 +44,7 @@ import org.apache.myfaces.config.element.NavigationRule;
 import org.apache.myfaces.config.element.ResourceBundle;
 import org.apache.myfaces.config.element.ViewPoolMapping;
 import org.apache.myfaces.config.element.facelets.FaceletTagLibrary;
+import org.apache.myfaces.util.Assert;
 
 /**
  * Holds all configuration information (from the faces-config xml files) that is needed later
during runtime. The config
@@ -210,9 +211,8 @@ public class RuntimeConfig
     public final void addConverterConfiguration(final String converterClassName,
             final org.apache.myfaces.config.element.Converter configuration)
     {
-        checkNull(converterClassName, "converterClassName");
-        checkEmpty(converterClassName, "converterClassName");
-        checkNull(configuration, "configuration");
+        Assert.notEmpty(converterClassName, "converterClassName");
+        Assert.notNull(configuration, "configuration");
 
         _converterClassNameToConfigurationMap.put(converterClassName, configuration);
     }
@@ -222,22 +222,6 @@ public class RuntimeConfig
         return (org.apache.myfaces.config.element.Converter)
                 _converterClassNameToConfigurationMap.get(converterClassName);
     }
-    
-    private void checkNull(final Object param, final String paramName)
-    {
-        if (param == null)
-        {
-            throw new NullPointerException(paramName + " can not be null.");
-        }
-    }
-
-    private void checkEmpty(final String param, final String paramName)
-    {
-        if (param.length() == 0)
-        {
-            throw new NullPointerException("String " + paramName + " can not be empty.");
-        }
-    }
 
     /**
      * Return the resourcebundle which was configured in faces config by var name
@@ -356,9 +340,8 @@ public class RuntimeConfig
     
     public void addFaceletProcessingConfiguration(String fileExtension, FaceletsProcessing
configuration)
     {
-        checkNull(fileExtension, "fileExtension");
-        checkEmpty(fileExtension, "fileExtension");
-        checkNull(configuration, "configuration");
+        Assert.notEmpty(fileExtension, "fileExtension");
+        Assert.notNull(configuration, "configuration");
 
         this._faceletsProcessingByFileExtension.put(fileExtension, configuration);
     }
diff --git a/impl/src/main/java/org/apache/myfaces/context/AjaxExceptionHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/context/AjaxExceptionHandlerImpl.java
index 290ac4b..967cf0d 100644
--- a/impl/src/main/java/org/apache/myfaces/context/AjaxExceptionHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/context/AjaxExceptionHandlerImpl.java
@@ -38,6 +38,7 @@ import javax.faces.event.AbortProcessingException;
 import javax.faces.event.ExceptionQueuedEvent;
 import javax.faces.event.ExceptionQueuedEventContext;
 import javax.faces.event.SystemEvent;
+import org.apache.myfaces.util.Assert;
 
 /**
  * 
@@ -98,22 +99,19 @@ public class AjaxExceptionHandlerImpl extends ExceptionHandler
      * {@inheritDoc}
      */
     @Override
-    public Throwable getRootCause(Throwable t)
+    public Throwable getRootCause(Throwable throwable)
     {
-        if (t == null)
-        {
-            throw new NullPointerException("t");
-        }
+        Assert.notNull(throwable, "throwable");
         
-        while (t != null)
+        while (throwable != null)
         {
-            Class<?> clazz = t.getClass();
+            Class<?> clazz = throwable.getClass();
             if (!clazz.equals(FacesException.class) && !clazz.equals(ELException.class))
             {
-                return t;
+                return throwable;
             }
             
-            t = t.getCause();
+            throwable = throwable.getCause();
         }
         
         return null;
diff --git a/impl/src/main/java/org/apache/myfaces/context/ExceptionHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/context/ExceptionHandlerImpl.java
index e42d399..fcb6ed9 100644
--- a/impl/src/main/java/org/apache/myfaces/context/ExceptionHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/context/ExceptionHandlerImpl.java
@@ -31,6 +31,7 @@ import javax.faces.event.AbortProcessingException;
 import javax.faces.event.ExceptionQueuedEvent;
 import javax.faces.event.ExceptionQueuedEventContext;
 import javax.faces.event.SystemEvent;
+import org.apache.myfaces.util.Assert;
 
 /**
  * DOCUMENT ME!
@@ -80,22 +81,19 @@ public class ExceptionHandlerImpl extends ExceptionHandler
      * {@inheritDoc}
      */
     @Override
-    public Throwable getRootCause(Throwable t)
+    public Throwable getRootCause(Throwable throwable)
     {
-        if (t == null)
-        {
-            throw new NullPointerException("t");
-        }
-        
-        while (t != null)
+        Assert.notNull(throwable, "throwable");
+
+        while (throwable != null)
         {
-            Class<?> clazz = t.getClass();
+            Class<?> clazz = throwable.getClass();
             if (!clazz.equals(FacesException.class) && !clazz.equals(ELException.class))
             {
-                return t;
+                return throwable;
             }
             
-            t = t.getCause();
+            throwable = throwable.getCause();
         }
         
         return null;
diff --git a/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java b/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java
index 240b125..ee02dcd 100755
--- a/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java
@@ -54,8 +54,6 @@ import org.apache.myfaces.util.Assert;
  */
 public class FacesContextImpl extends FacesContextImplBase
 {
-
-    private static final String METHOD_RESPONSEWRITER = "responseWriter";
     static final String RE_SPLITTER = "[\\s\\t\\r\\n]*\\,[\\s\\t\\r\\n]*";
     
     // ~ Instance fields ----------------------------------------------------------------------------
@@ -176,14 +174,14 @@ public class FacesContextImpl extends FacesContextImplBase
 
         if (_messages == null)
         {
-            _messages = new LinkedHashMap<String, List<FacesMessage>>();
-            _orderedMessages = new ArrayList<FacesMessage>();
+            _messages = new LinkedHashMap<>();
+            _orderedMessages = new ArrayList<>();
         }
         
         List<FacesMessage> lst = _messages.get(clientId); 
         if (lst == null)
         {
-            lst = new ArrayList<FacesMessage>();
+            lst = new ArrayList<>();
             _messages.put(clientId, lst);
         }
         
@@ -360,10 +358,8 @@ public class FacesContextImpl extends FacesContextImplBase
     {
         assertNotReleased();
 
-        if (responseWriter == null)
-        {
-            throw new NullPointerException(METHOD_RESPONSEWRITER);
-        }
+        Assert.notNull(responseWriter, "responseWriter");
+        
         _responseWriter = responseWriter;
     }
 
diff --git a/impl/src/main/java/org/apache/myfaces/util/ParametrizableFacesMessage.java b/impl/src/main/java/org/apache/myfaces/util/ParametrizableFacesMessage.java
index 384f7b1..f7f2983 100644
--- a/impl/src/main/java/org/apache/myfaces/util/ParametrizableFacesMessage.java
+++ b/impl/src/main/java/org/apache/myfaces/util/ParametrizableFacesMessage.java
@@ -31,9 +31,6 @@ import javax.faces.context.FacesContext;
  */
 public class ParametrizableFacesMessage extends FacesMessage
 {
-    /**
-     * 
-     */
     private static final long serialVersionUID = 7792947730961657948L;
 
     private final Object _args[];
@@ -46,10 +43,9 @@ public class ParametrizableFacesMessage extends FacesMessage
             String summary, String detail, Object[] args, Locale locale)
     {
         super(summary, detail);
-        if(locale == null)
-        {
-            throw new NullPointerException("locale");
-        }
+
+        Assert.notNull(locale, "locale");
+        
         _locale = locale;
         _args = args;
     }
@@ -58,10 +54,9 @@ public class ParametrizableFacesMessage extends FacesMessage
             String summary, String detail, Object[] args, Locale locale)
     {
         super(severity, summary, detail);
-        if(locale == null)
-        {
-            throw new NullPointerException("locale");
-        }
+
+        Assert.notNull(locale, "locale");
+        
         _locale = locale;
         _args = args;
     }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/AbstractFaceletCache.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/AbstractFaceletCache.java
index 59a3307..aa59c0f 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/AbstractFaceletCache.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/AbstractFaceletCache.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.net.URL;
 import javax.faces.view.facelets.FaceletCache;
 import javax.faces.view.facelets.FaceletContext;
+import org.apache.myfaces.util.Assert;
 
 /**
  * Extended FaceletCache contract that supports additional Myfaces specific concepts
@@ -79,10 +80,8 @@ public abstract class AbstractFaceletCache<V> extends FaceletCache<V>
                                       FaceletCache.MemberFactory<V> viewMetadataFaceletFactory,
                                       FaceletCache.MemberFactory<V> compositeComponentMetadataFaceletFactory)
     {
-        if  (compositeComponentMetadataFaceletFactory == null)
-        {
-            throw new NullPointerException("viewMetadataFaceletFactory is null");
-        }
+        Assert.notNull(compositeComponentMetadataFaceletFactory, "compositeComponentMetadataFaceletFactory");
+        
         _compositeComponentMetadataFaceletFactory = compositeComponentMetadataFaceletFactory;
         setCacheFactories(faceletFactory, viewMetadataFaceletFactory);
     }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java
index 6ea3440..8c6a0d9 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java
@@ -45,6 +45,7 @@ import javax.faces.event.FacesListener;
 import javax.faces.render.Renderer;
 
 import javax.faces.view.Location;
+import org.apache.myfaces.util.Assert;
 
 import org.apache.myfaces.util.SharedStringBuilder;
 import org.apache.myfaces.util.ComponentUtils;
@@ -63,10 +64,7 @@ class UILeaf extends UIComponent implements UntargetableComponent, Map<String,
O
     @Override
     public String getClientId(FacesContext context)
     {
-        if (context == null)
-        {
-            throw new NullPointerException("context");
-        }
+        Assert.notNull(context, "context");
 
         if (_clientId != null)
         {
@@ -166,54 +164,11 @@ class UILeaf extends UIComponent implements UntargetableComponent, Map<String,
O
         // UILeaf instance are just a wrapper for html markup. It never has 
         // an user defined id. The validation check here is just useless, 
         // because facelets algorithm ensures that.
-        //isIdValid(id);
+
         _id = id;
         _clientId = null;
     }
-    /*
-    private void isIdValid(String string)
-    {
-
-        // is there any component identifier ?
-        if (string == null)
-        {
-            return;
-        }
-
-        // Component identifiers must obey the following syntax restrictions:
-        // 1. Must not be a zero-length String.
-        if (string.length() == 0)
-        {
-            throw new IllegalArgumentException("component identifier must not be a zero-length
String");
-        }
-
-        // If new id is the same as old it must be valid
-        if (string.equals(_id))
-        {
-            return;
-        }
-
-        // 2. First character must be a letter or an underscore ('_').
-        if (!Character.isLetter(string.charAt(0)) && string.charAt(0) != '_')
-        {
-            throw new IllegalArgumentException("component identifier's first character must
be a letter "
-                                               + "or an underscore ('_')! But it is \""
-                                               + string.charAt(0) + "\"");
-        }
-        for (int i = 1; i < string.length(); i++)
-        {
-            char c = string.charAt(i);
-            // 3. Subsequent characters must be a letter, a digit, an underscore ('_'), or
a dash ('-').
-            if (!Character.isLetterOrDigit(c) && c != '-' && c != '_')
-            {
-                throw new IllegalArgumentException("Subsequent characters of component identifier
must be a letter, "
-                                                   + "a digit, an underscore ('_'), or a
dash ('-')! "
-                                                   + "But component identifier contains \""
-                                                   + c + "\"");
-            }
-        }
-    }*/
-    
+ 
     private String getComponentLocation(UIComponent component)
     {
         Location location = (Location) component.getAttributes()
@@ -675,10 +630,8 @@ class UILeaf extends UIComponent implements UntargetableComponent, Map<String,
O
 
     private void checkKey(Object key)
     {
-        if (key == null)
-        {
-            throw new NullPointerException("key");
-        }
+        Assert.notNull(key, "key");
+        
         if (!(key instanceof String))
         {
             throw new ClassCastException("key is not a String");
@@ -689,7 +642,7 @@ class UILeaf extends UIComponent implements UntargetableComponent, Map<String,
O
     {
         if (_attributes == null)
         {
-            _attributes = new HashMap<String, Object>(2,1);
+            _attributes = new HashMap<>(2, 1);
         }
         return _attributes;
     }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java b/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
index 0aff7fe..2e8a5d6 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
@@ -58,6 +58,7 @@ import javax.faces.render.Renderer;
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
 import org.apache.myfaces.cdi.model.DataModelBuilderProxy;
+import org.apache.myfaces.util.Assert;
 import org.apache.myfaces.util.SharedStringBuilder;
 import org.apache.myfaces.util.ExternalSpecifications;
 
@@ -282,11 +283,9 @@ public class UIRepeat extends UIComponentBase implements NamingContainer
     @Override
     public void setValueExpression(String name, ValueExpression binding)
     {
-        if (name == null)
-        {
-            throw new NullPointerException("name");
-        }
-        else if (name.equals("value"))
+        Assert.notNull(name, "name");
+
+        if (name.equals("value"))
         {
             _dataModelMap.clear();
         }
@@ -1111,10 +1110,9 @@ public class UIRepeat extends UIComponentBase implements NamingContainer
     public boolean invokeOnComponent(FacesContext context, String clientId,
             ContextCallback callback) throws FacesException
     {
-        if (context == null || clientId == null || callback == null)
-        {
-            throw new NullPointerException();
-        }
+        Assert.notNull(context, "context");
+        Assert.notNull(clientId, "clientId");
+        Assert.notNull(callback, "callback");
         
         final String baseClientId = getClientId(context);
 
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/el/DefaultFunctionMapper.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/el/DefaultFunctionMapper.java
index 5f41b01..e4dfc17 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/el/DefaultFunctionMapper.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/el/DefaultFunctionMapper.java
@@ -27,6 +27,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.el.FunctionMapper;
+import org.apache.myfaces.util.Assert;
 import org.apache.myfaces.util.ClassUtils;
 
 
@@ -115,34 +116,20 @@ public final class DefaultFunctionMapper extends FunctionMapper implements
Exter
         private static final long serialVersionUID = 1L;
 
         protected transient Method _m;
-
         protected String _owner;
-
         protected String _name;
-
         protected String[] _types;
-
         protected String _prefix;
-
         protected String _localName;
 
-        /**
-         * 
-         */
-        public Function(String prefix, String localName, Method m)
+        public Function(String prefix, String localName, Method method)
         {
-            if (localName == null)
-            {
-                throw new NullPointerException("LocalName cannot be null");
-            }
-            if (m == null)
-            {
-                throw new NullPointerException("Method cannot be null");
-            }
+            Assert.notNull(localName, "localName");
+            Assert.notNull(method, "method");
             
             _prefix = prefix;
             _localName = localName;
-            _m = m;
+            _m = method;
         }
 
         public Function()


Mime
View raw message