luehe       2002/08/30 09:54:09

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed 12109: Using functions in EL causes a NPE to be thrown in the
               GenerateELFunctionMap.java
  
  Revision  Changes    Path
  1.86      +17 -11    
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- Generator.java    30 Aug 2002 01:43:53 -0000      1.85
  +++ Generator.java    30 Aug 2002 16:54:09 -0000      1.86
  @@ -589,15 +589,21 @@
                           new JspUtil.FunctionSignature( fnSignature, 
                           tli.getShortName(), err );
                       out.print( quote( functionSignature.getMethodName() ) );
  -                    out.print( ", new Class[] {" );
  +                    out.print(", ");
                       Class[] args = functionSignature.getParameterTypes();
  -                    for( int j = 0; j < args.length; j++ ) {
  -                        out.print( args[j].getName() + ".class" );
  -                        if( j < (args.length - 1) ) {
  -                            out.print( ", " );
  -                        }
  -                    }
  -                    out.println( "} ) );" );
  +                 if (args != null) {
  +                     out.print("new Class[] {" );
  +                     for( int j = 0; j < args.length; j++ ) {
  +                         out.print( args[j].getName() + ".class" );
  +                         if( j < (args.length - 1) ) {
  +                             out.print( ", " );
  +                         }
  +                     }
  +                     out.print("} ");
  +                 } else {
  +                     out.print("null");
  +                 }
  +                    out.println("));");
                   }
               }
               out.popIndent();
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to