commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/ant TaskPropertyTag.java
Date Fri, 14 Jun 2002 17:16:08 GMT
jstrachan    2002/06/14 10:16:08

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/ant
                        TaskPropertyTag.java
  Log:
  patched the code to avoid the use of the crappy Class.getMethod(String. Class[]) call which
throws an exception if the method isn't found.
  Now using the nice helper method that comes from beanutils
  
  Revision  Changes    Path
  1.7       +4 -1      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/ant/TaskPropertyTag.java
  
  Index: TaskPropertyTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/ant/TaskPropertyTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TaskPropertyTag.java	14 Jun 2002 10:24:14 -0000	1.6
  +++ TaskPropertyTag.java	14 Jun 2002 17:16:08 -0000	1.7
  @@ -68,6 +68,7 @@
   import org.apache.commons.beanutils.ConvertingWrapDynaBean;
   import org.apache.commons.beanutils.BeanUtils;
   import org.apache.commons.beanutils.DynaBean;
  +import org.apache.commons.beanutils.MethodUtils;
   
   import org.apache.commons.jelly.CompilableTag;
   import org.apache.commons.jelly.DynaBeanTagSupport;
  @@ -112,7 +113,9 @@
           Task task = tag.getTask();
           Class taskClass = task.getClass();
           String methodName = "create" + name.substring(0,1).toUpperCase() + name.substring(1);
  -        Method method = taskClass.getMethod( methodName, emptyParameterTypes );
  +        Method method = MethodUtils.getAccessibleMethod(
  +            taskClass, methodName, emptyParameterTypes 
  +        );
           if ( method == null ) {
               throw new JellyException( 
                   "Cannot create Task property: " + name + " of Ant task: " + task 
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message