From 974602f8ff9c7210f34701e29b6ac5443be05aeb Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Wed, 18 Dec 2024 12:24:32 -0500 Subject: [PATCH] allow passing empty 'package' to 'java_test_suite' (#312) 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`. --- java/private/package.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/private/package.bzl b/java/private/package.bzl index 5f705fa4..a7f56abd 100644 --- a/java/private/package.bzl +++ b/java/private/package.bzl @@ -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 + "."