tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java Parser.java TagLibraryInfoImpl.java Validator.java
Date Thu, 17 Oct 2002 21:38:57 GMT
luehe       2002/10/17 14:38:56

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
                        Node.java Parser.java TagLibraryInfoImpl.java
                        Validator.java
  Log:
  Check for null before enumerating over array returned by TagInfo.getAttributes() and TagInfo.getTagVariableInfos()
(see Bugzilla 13619).
  
  Revision  Changes    Path
  1.111     +5 -8      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.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- Generator.java	17 Oct 2002 20:43:06 -0000	1.110
  +++ Generator.java	17 Oct 2002 21:38:56 -0000	1.111
  @@ -2109,9 +2109,6 @@
   				       String tagHandlerVar,
   				       String tagEvalVar) {
   
  -	    VariableInfo[] varInfos = n.getVariableInfos();
  -	    TagVariableInfo[] tagVarInfos = n.getTagVariableInfos();
  -
   	    if (n.getBody() != null) {
   		if (n.implementsIterationTag()) {
   		    out.printin("int evalDoAfterBody = ");
  @@ -3081,8 +3078,8 @@
           out.printil( "// Sync up variables with caller's page context:" );
           
           TagVariableInfo[] tagVariableInfo = tagInfo.getTagVariableInfos();
  -        
  -        for( int i = 0; i < tagVariableInfo.length; i++ ) {
  +        for( int i = 0; tagVariableInfo != null
  +		 && i < tagVariableInfo.length; i++ ) {
               // XXX - Spec bug: Note, we don't know the value of 
               // this attribute at translation time, because we're defining
               // the tag, and we don't know how page authors will call it.
  
  
  
  1.35      +4 -4      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Node.java	17 Oct 2002 20:43:06 -0000	1.34
  +++ Node.java	17 Oct 2002 21:38:56 -0000	1.35
  @@ -1183,7 +1183,7 @@
               boolean result = false;
   
   	    TagAttributeInfo[] attributes = tagInfo.getAttributes();
  -	    for (int i = 0; i < attributes.length; i++) {
  +	    for (int i = 0; attributes != null && i < attributes.length; i++) {
   		if (attributes[i].getName().equals(name) &&
   		            attributes[i].isFragment()) {
   		    result = true;
  
  
  
  1.35      +4 -4      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Parser.java	17 Oct 2002 20:43:06 -0000	1.34
  +++ Parser.java	17 Oct 2002 21:38:56 -0000	1.35
  @@ -1718,7 +1718,7 @@
   	if (n instanceof Node.CustomTag) {
   	    TagInfo tagInfo = ((Node.CustomTag)n).getTagInfo();
   	    TagAttributeInfo[] tldAttrs = tagInfo.getAttributes();
  -	    for (int i=0; i<tldAttrs.length; i++) {
  +	    for (int i=0; tldAttrs != null && i<tldAttrs.length; i++) {
   		if (name.equals(tldAttrs[i].getName())) {
   		    if (tldAttrs[i].isFragment()) {
   		        return TagInfo.BODY_CONTENT_SCRIPTLESS;
  
  
  
  1.20      +15 -10    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
  
  Index: TagLibraryInfoImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- TagLibraryInfoImpl.java	17 Oct 2002 20:43:06 -0000	1.19
  +++ TagLibraryInfoImpl.java	17 Oct 2002 21:38:56 -0000	1.20
  @@ -372,13 +372,18 @@
                                     );
   	    }
   	}
  -	TagAttributeInfo[] tagAttributeInfo 
  -            = new TagAttributeInfo[attributeVector.size()];
  -	attributeVector.copyInto(tagAttributeInfo);
   
  -	TagVariableInfo[] tagVariableInfos
  -            = new TagVariableInfo[variableVector.size()];
  -	variableVector.copyInto(tagVariableInfos);
  +	TagAttributeInfo[] tagAttributeInfo = null;
  +	if (attributeVector.size() > 0) {
  +            tagAttributeInfo = new TagAttributeInfo[attributeVector.size()];
  +	    attributeVector.copyInto(tagAttributeInfo);
  +	}
  +
  +	TagVariableInfo[] tagVariableInfos = null;
  +	if (variableVector.size() > 0) {
  +            tagVariableInfos = new TagVariableInfo[variableVector.size()];
  +	    variableVector.copyInto(tagVariableInfos);
  +	}
   
           TagExtraInfo tei = null;
           if (teiclass != null && !teiclass.equals("")) {
  
  
  
  1.44      +4 -4      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- Validator.java	17 Oct 2002 20:43:06 -0000	1.43
  +++ Validator.java	17 Oct 2002 21:38:56 -0000	1.44
  @@ -662,7 +662,7 @@
   	     */
   	    TagAttributeInfo[] tldAttrs = tagInfo.getAttributes();
   	    Attributes attrs = n.getAttributes();
  -	    for (int i=0; i<tldAttrs.length; i++) {
  +	    for (int i=0; tldAttrs != null && i<tldAttrs.length; i++) {
   		String attr = attrs.getValue(tldAttrs[i].getName());
   		Node.NamedAttribute jspAttr =
   			n.getNamedAttributeNode(tldAttrs[i].getName());
  
  
  

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


Mime
View raw message