apache / apache/gravitino

[Improvement] Creating a namespace from just white space should not be allowed

Open
#7,958 8 comments 0 reactions 1 assignee Claimed by @yossev View on GitHub
good first issue improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.