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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to