DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5561>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5561

Mangling of reserved words not working some times

           Summary: Mangling of reserved words not working some times
           Product: Tomcat 3
           Version: 3.3 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Servlet
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I detected an error on package name mangling. Reserved works were not mangled 
if they were not the last part of the JSP path.

The problem was in this snippet of code in 
org.apache.tomcat.util.JavaGeneratorTool.manglePackage(String):

...
if ((s.length() > endIdx + 1) && s.charAt(endIdx + 1) != '/')
{
  index = s.indexOf(keywords[i], index + 3);
  continue;
}
...

There is an error in there since endIdx is already at the character immediately 
after the reserved work. The "+1" moves the index one character further, which 
is the first letter in the JSP's next directory.

Removing the +1 corrected the problem:

...
if ((s.length() > endIdx) && s.charAt(endIdx) != '/')
{
  index = s.indexOf(keywords[i], index + 3);
  continue;
}
...

Thks

PD I put this in servlet. Sorry if it dooes not belong there.
PD I don't know if the severity is OK. For us it is a MAJOR since our site 
uses "public" in one directory, and there are lots of dirs under it, making 
TC3.3 unusable with this bug.

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

Reply via email to