Skip to content

Commit

Permalink
allow passing empty 'package' to 'java_test_suite' (#312)
Browse files Browse the repository at this point in the history
If for whatever reason one has test classes in the unnamed package, the
current logic for detecting the full classname will return something
like `src.test.java.FoobarTest` when you specify `package = ""` because
of the truthiness test in `get_class_name`.
  • Loading branch information
mattnworb authored Dec 18, 2024
1 parent 27d392c commit 974602f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/private/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_class_name(package, src, prefixes = []):
# safe to add the class name. While `get_package_name` does
# the right thing, the parameter passed by a user may not
# so we shall check once we have `pkg` just to be safe.
pkg = package if package else get_package_name(prefixes)
pkg = package if package != None else get_package_name(prefixes)
if len(pkg) and not pkg.endswith("."):
pkg = pkg + "."

Expand Down

0 comments on commit 974602f

Please sign in to comment.