tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pier...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler TagBeginGenerator.java
Date Thu, 14 Dec 2000 22:28:28 GMT
pierred     00/12/14 14:28:28

  Modified:    src/share/org/apache/jasper/compiler Tag: tomcat_32
                        TagBeginGenerator.java
  Log:
  When the Jasper code gets the setter method for tag properties, it doesn't
  check to see whether the m variable is null until after attempting to use its
  getParameterTypes() method, which throws an uninformative NullPointerException.
  I simply moved the null check immediately after the variable m is set.
  
  [This was already fixed in tomcat-4.0; porting back to tomcat-3.2]
  
  Submitted by: Kief Morris <kief@bitBull.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.14.2.3  +5 -8      jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java
  
  Index: TagBeginGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
  retrieving revision 1.14.2.2
  retrieving revision 1.14.2.3
  diff -u -r1.14.2.2 -r1.14.2.3
  --- TagBeginGenerator.java	2000/07/12 16:04:51	1.14.2.2
  +++ TagBeginGenerator.java	2000/12/14 22:28:27	1.14.2.3
  @@ -193,6 +193,11 @@
                   if (attrValue != null) {
   		    String attrName = attributes[i].getName();
   		    Method m = tc.getSetterMethod(attrName);
  +		    if (m == null)
  +			throw new CompileException
  +			    (start, Constants.getString
  +			     ("jsp.error.unable.to_find_method",
  +			      new Object[] { attrName }));
                       Class c[] = m.getParameterTypes();
                       // assert(c.length > 0)
   
  @@ -203,14 +208,6 @@
                               attrValue = convertString(c[0], attrValue, writer, attrName);
   		    } else
   			attrValue = convertString(c[0], attrValue, writer, attrName);
  -
  -
  -		    if (m == null)
  -			throw new CompileException
  -			    (start, Constants.getString
  -			     ("jsp.error.unable.to_find_method",
  -			      new Object[] { attrName }));
  -
   		    writer.println(thVarName+"."+m.getName()+"("+attrValue+");");
                   }
               }
  
  
  

Mime
View raw message