apache/gravitino
在 GitHub 查看[Improvement] Creating a namespace from just white space should not be allowed
Open
#7,958 创建于 2025年8月7日
good first issueimprovement
仓库指标
- Star
- (3,058 star)
- PR 合并指标
- (PR 指标待抓取)
描述
What would you like to be improved?
Update this test to the following, and the test will fail.
@Test
public void testFromStringInvalidArgs() {
Assertions.assertThrows(IllegalArgumentException.class, () -> Namespace.fromString(null));
Assertions.assertThrows(IllegalArgumentException.class, () -> Namespace.fromString(".a"));
Assertions.assertThrows(IllegalArgumentException.class, () -> Namespace.fromString("a."));
Assertions.assertThrows(IllegalArgumentException.class, () -> Namespace.fromString("a..b"));
Assertions.assertThrows(IllegalArgumentException.class, () -> Namespace.fromString(" "));
}
How should we improve?
Update Namespace.fromString to throw a IllegalArgumentException if given a namespace that is just whitespace