Bug found:
WorkerFactory.newWorker(taskQueue) validates against null and empty strings but not blank/whitespace-only strings:
Code snippet:
Preconditions.checkArgument(
!Strings.isNullOrEmpty(taskQueue), "taskQueue should not be an empty string");
This means factory.newWorker(" ") silently passes validation and creates a worker with a whitespace-only task queue name, which will fail at the server level with a cryptic error rather than a clear, early IllegalArgumentException.
Expected Behavior:
newWorker(" ") should throw IllegalArgumentException with a clear message.
Actual Behavior:
newWorker(" ") passes validation silently.
PS:
Other parts of this codebase already handle this correctly —
StartNexusOperationOptions.setId() uses trim().isEmpty() for the same reason.
Bug found:
WorkerFactory.newWorker(taskQueue)validates against null and empty strings but not blank/whitespace-only strings:Code snippet:
Preconditions.checkArgument(
!Strings.isNullOrEmpty(taskQueue), "taskQueue should not be an empty string");
This means
factory.newWorker(" ")silently passes validation and creates a worker with a whitespace-only task queue name, which will fail at the server level with a cryptic error rather than a clear, early IllegalArgumentException.Expected Behavior:
newWorker(" ")should throwIllegalArgumentExceptionwith a clear message.Actual Behavior:
newWorker(" ")passes validation silently.PS:
Other parts of this codebase already handle this correctly —
StartNexusOperationOptions.setId()usestrim().isEmpty()for the same reason.