Attempt to parse the attached file and you will get an infinite loop while parsing the JSP tag.
The JSP parser reads the '/'. On reading the next character it gets EOF, determines that this is not a '/' or a '*', and "ungets" the character. But as Page.getCharacter did not actually advance the cursor, effectively this moves the cursor back ready to read the slash again. Hilarity ensues.
The fix could be done in two ways.
1. Modify Lexer.parseJsp so that it doesn't unget the
character in the event of EOF, and perhaps exposes
the stray '/' as an ordinary string.
2. Modify Page.getCharacter so that it does advance
cursor even if it reads an EOF. This sounds
potentially evil but would solve other situations
where similar bugs might occur without having to fix
multiple locations in the code.
I can do the fix myself but I don't want to be the one to make this decision, so please advise. :-)
Problems occurs on stable 1.6 version as well as trunk/2.0.
Proposed fix for this particular situation.
Logged In: YES
user_id=639492
Originator: YES
Attaching a patch which fixes this particular example. However some thought should be given to advancing the cursor even in the event of EOF, to fix all similar problems which might be introduced in the future.
File Added: jsp-infinite-loop-fix.patch
Logged In: YES
user_id=605407
Originator: NO
Applied patch provided by Trejkaz.