Commit 2f851e9
authored
97 implement null handling with jspecify (#120)
* - Added jspecify to pom.xml
- @NullMarked to src/main/java/org/example
- Checked all files in example for handling null return values.
* - @NullMarked to src/main/java/org/example/config
- Checked all files for handling null return values
* - Added @NullMarked to src/main/java/org/example/filter package
- Checked all files for handling null return values
* - Added @NullMarked to src/main/java/org/example/http package
- Checked all files for handling null return values
* - Added @NullMarked to src/main/java/org/example/httpparser package
- Checked all files for handling null return values
* - Added @NullMarked to src/main/java/org/example/server package
- Checked all files for handling null return values
* - Added @NullMarked to src/test/java/org/example package
- Checked all files for handling null return values
* - Added @NullMarked to src/test/java/org/example/config package
- Checked ConfigLoaderTest for null handling
* - Added @NullMarked to src/test/java/org/example/filter package
- Checked all tests for null handling
- Marked body in HttpRequest parameters as nullable to satisfy tests in CompressionFilterTest.
- Marked ip parameters for normalizeIp, addBlockedIp and addAllowedIp to be Nullable since they work as intended but warnings need to be suppressed.
-Added @nullable to request parameter for doFilter in LocaleFilter since it is handled.
* - Added @NullMarked to src/test/java/org/example/http package
- Checked all tests for null handling
- Marked filename parameter in detectMimeType as Nullable since it's handled.
* - Added @NullMarked to src/test/java/org/example/httpparser package
- Checked all tests for null handling
- Marked "in" parameter for setReader in HttpParser as nullable since it is handled.
* - Added @NullMarked to src/test/java/org/example/server package
- Checked ConfigurableFilterPipelineTest for null handling
- Marked the routePatterns parameter in the FilterRegistration record in FilterRegistration.java since it is safely null handled.
* Applied suggested CodeRabbit fixes to Major Issues regarding null markings and null handling.
* CodeRabbit test went against intended outcome of test. Rollbacked change to SetReader in HttpParser
* - LocaleFilteR: Moved @nullable from doFilter request parameter to resolveLocale request parameter since resolveLocale does the actual null handling.
- Removed testParserThrowErrorWhenNull test since it is made redundant by jspecify null marking.
* - Fixed compilation errors.
- Tests and compilation run without issue on my local setup now.1 parent f9c69a4 commit 2f851e9
22 files changed
Lines changed: 74 additions & 24 deletions
File tree
- src
- main/java/org/example
- config
- filter
- httpparser
- http
- server
- test/java/org/example
- config
- filter
- httpparser
- http
- server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
73 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | | - | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | | - | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
Whitespace-only changes.
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments