Bug 63115 - JSP standalone compilation doesn't work. First folder in path is duplicate
Summary: JSP standalone compilation doesn't work. First folder in path is duplicate
Status: CLOSED DUPLICATE of bug 63056
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 9.0.14
Hardware: PC All
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2019-01-25 13:34 UTC by Philippe
Modified: 2019-01-30 16:31 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Philippe 2019-01-25 13:34:36 UTC
In org.apache.jasper.JsjC class

the method "scanFilesInternal" use "context.getResourcePaths(input)" method to retrieve all resources available in "input" folder.
but all the paths returned by this method start with the value contains in "input" variable.
Then, scanFilesInternal iterate other all paths returned and call scanFilesInternal again (recursivity) for each of then. 
But, the value contains in "input" variable is concatenate with the current path (which already start with the value contains in "input"). So, the first part of the path is duplicated.

private void scanFilesInternal(String input) {       <= input = /jsp/
Set<String> paths = context.getResourcePaths(input); <= paths [/jsp/home/,/jsp/actu/..]
  scanFilesInternal(input.substring(0, input.length() -1) + path);
           =>  scanFilesInternal("/jsp"+"/jsp/home/")<= /jsp/ appears twice!!

Comment 1 Mark Thomas 2019-01-25 17:22:49 UTC
Although the duplicate description is different, I believe these issues are the same. Please re-test with a build of the latest code from svn. If it helps, I can provide you with a pre-built tar.gz (Linux) or .zip (Windows) for testing.

*** This bug has been marked as a duplicate of bug 63056 ***
Comment 2 Philippe 2019-01-29 16:33:41 UTC
If you can provide me a pre-build for linux, I can re-test and confirm bug duplication.
Comment 3 Mark Thomas 2019-01-29 20:32:07 UTC
This is an entirely untested build of the latest svn source. Use it at your own risk.

Comment 4 Philippe 2019-01-30 16:31:16 UTC
bug fixed, thanks