tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30409] New: - Bad error message when taglib shortname is null
Date Fri, 30 Jul 2004 14:13:17 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30409

Bad error message when taglib shortname is null

           Summary: Bad error message when taglib shortname is null
           Product: Tomcat 4
           Version: 4.1.29
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Jasper 2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: masque@inetsolve.com


This code:
public abstract class TagLibraryInfo {
...
public TagInfo getTag(String shortname) {

...

/* 190*/        for (int i = 0; i < tags.length; i++)
/* 191*/            if (tags[i].getTagName().equals(shortname))
/* 192*/                return tags[i];
...
}
...
}

Causes an NPE if shortName is an empty element.  Thank god for the eclipse
sysdeo debugger!  The code should either check for null:

if(shortname == null || shortname.length()==0){
System.err("a tags name is null, please check your .tld");
return null;
}

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


Mime
View raw message