Skip to content

Commit e068e21

Browse files
committed
Check for Shadow Gradle plugin prefix in shaded package query
1 parent 9553180 commit e068e21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

codeql-custom-queries-java/queries/likely-bugs/importing-shaded-package.ql

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ where
3535
package = getPackage(importStmt) and
3636
exists(string packageName, int index |
3737
packageName = package.getName() and
38-
exists(packageName.regexpFind("(^|\\.)(shaded|repackaged)($|\\.)", 0, index)) and
38+
// `shadow` is the default prefix of the Shadow Gradle plugin (https://github.com/johnrengelman/shadow)
39+
exists(packageName.regexpFind("((^|\\.)(shaded|repackaged)($|\\.))|(^shadow\\.)", 0, index)) and
3940
shadedPackagePrefix = packageName.prefix(index)
4041
) and
4142
// And shaded classes are not somehow part of the sources

0 commit comments

Comments
 (0)