Commit 1307449
authored
feat: Add JSpecify nullability annotations (package-url#175)
* Add nullability annotations
This change adds nullability annotations ([JSpecify](https://jspecify.dev)) to `packageurl-java` and modifies somes behavior. Specifically:
- It marks with `@Nullable` all public methods that can return `null`.
- It marks with `@Nullable` all method parameters that can have a `null` value **without** throwing any exception.
- It modifies the behavior of the remaining parameters: passing `null` to those parameters will result in an NPE, instead of `MalformedPackageURLException`. This is at least a behavior change (minor version bump), but it _might_ be a breaking change.
* Fix qualifier semantics1 parent 681b0aa commit 1307449
File tree
9 files changed
+230
-159
lines changed- src
- main/java/com/github/packageurl
- validator
- test/java/com/github/packageurl
9 files changed
+230
-159
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
0 commit comments