Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalisation for whitelistPathsNonRecursive #425

Closed
richard-melvin opened this issue May 1, 2020 · 1 comment
Closed

Normalisation for whitelistPathsNonRecursive #425

richard-melvin opened this issue May 1, 2020 · 1 comment

Comments

@richard-melvin
Copy link

Calling this function with app-data/templates/uml works to find the resource files , but with app-data/templates/uml/ doesn't.

The verbose log reports:

INFO: 2020-05-01T13:58:43.893+0100	ClassGraph	ClassGraph version 4.8.77
2020-05-01T13:58:43.894+0100	ClassGraph	Operating system: Windows 10 10.0 amd64
2020-05-01T13:58:43.894+0100	ClassGraph	Java version: 11.0.2 / 11.0.2+9 (Oracle Corporation)
2020-05-01T13:58:43.894+0100	ClassGraph	Java home: C:\Program Files\OpenJDK\jdk-11.0.2
2020-05-01T13:58:43.900+0100	ClassGraph	ScanSpec:
2020-05-01T13:58:43.900+0100	ClassGraph	-- packageWhiteBlackList: whitelist: ["app-data.templates.uml."]; whitelistPrefixes: ["", "/", "app-data.", "app-data.templates.", "app-data.templates.uml."]
2020-05-01T13:58:43.901+0100	ClassGraph	-- packagePrefixWhiteBlackList: 
2020-05-01T13:58:43.901+0100	ClassGraph	-- pathWhiteBlackList: whitelist: ["app-data/templates/uml//"]; whitelistPrefixes: ["", "/", "app-data/", "app-data/templates/", "app-data/templates/uml/"]

Code fragment:

    assert !dirPath.startsWith("/");
    assert !dirPath.endsWith("/");

    try (ScanResult scanResult =
      new ClassGraph().verbose().whitelistPathsNonRecursive(dirPath + "/").scan())
    {

This finds nothing; omitting the `+ "/"` works.```


@lukehutch
Copy link
Member

@richard-melvin Thanks for the report. This should be fixed, and will be released in 4.8.78 once a couple of other things are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants