Affects PMD Version: 6.7.0
Rule: None
Description: I use pmd-jsp.jar to tokenize the jsp source file, and I want to extract jspscriptlet from the file, but the bound about "%>" has some problems.
Code Sample demonstrating the issue:
//just get the token list
String filepath = "C:\\test.jsp";
File f = new File(filepath);
InputStreamReader isr = new InputStreamReader(new FileInputStream(f));
JspTokenManager jspTokenManager = new JspTokenManager(isr);
List<Token> tokenList = new ArrayList<Token>();
Token token = (Token)jspTokenManager.getNextToken();
tokenList.add(token);
while (!token.image.isEmpty()){
token = (Token)jspTokenManager.getNextToken();
tokenList.add(token);
}
Following is a part of source code:
<%
String nodeContent = "<% %>";
%>
<%
<![cdata[
String nodeContent = "<% %>";
]]>
%>
And the token list is below:
"<%", "\nString nodeContent = \"<%lalal" ,"%>", "lalala\";%>\n"
"<%", "\n<![cdata[\nString nodeContent = \"<%", "%>", "\";\n]]>\n%>"
So the bound about "%>" has some problems.
Running PMD through: pmd-jsp-6.7.0.jar & pmd-core-6.7.0.jar
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4