Skip to content

Commit

Permalink
[java] Drop the prefix created by Bazel (#12173)
Browse files Browse the repository at this point in the history
Drop the prefix created by Bazel

Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
joerg1985 and diemol authored Jun 9, 2023
1 parent 3dc8903 commit 505abc3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion java/src/dev/selenium/tools/modules/ModuleGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,14 @@ private static class MyModuleVisitor extends VoidVisitorAdapter<Void> {

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

@Override
Expand Down

0 comments on commit 505abc3

Please sign in to comment.