Skip to content

Commit 505abc3

Browse files
joerg1985diemol
andauthored
[java] Drop the prefix created by Bazel (#12173)
Drop the prefix created by Bazel Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
1 parent 3dc8903 commit 505abc3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

java/src/dev/selenium/tools/modules/ModuleGenerator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,14 @@ private static class MyModuleVisitor extends VoidVisitorAdapter<Void> {
466466

467467
@Override
468468
public void visit(ModuleRequiresDirective n, Void arg) {
469+
String name = n.getNameAsString();
470+
if (name.startsWith("processed_")) {
471+
// When 'Automatic-Module-Name' is not set, we must derive the module name from the jar file
472+
// name. Therefore, the 'processed_' prefix added by bazel must be removed to get the name.
473+
name = name.substring(10);
474+
}
469475
byteBuddyVisitor.visitRequire(
470-
n.getNameAsString(), getByteBuddyModifier(n.getModifiers()), null);
476+
name, getByteBuddyModifier(n.getModifiers()), null);
471477
}
472478

473479
@Override

0 commit comments

Comments
 (0)