Commit f7f6ace
authored
Fix redundant null checks (#4326)
* Fix redundant null checks identified by SpotBugs
* Fix redundant nullcheck warnings from SpotBugs
Removed redundant null checks and comparisons in multiple files as identified by SpotBugs.
- Socket.java: Removed check for connection != null.
- GroupLayout.java: Removed check for name != null.
- Form.java: Removed checks for focused != null and atXY != null.
- Resources.java: Removed checks for mediaRules != null.
- Component.java: Removed check for cmp != null.
- Command.java: Removed check for obj != null.
- ComponentSelector.java: Removed check for mgr != null.
- PropertyIndex.java: Removed check for p != null.
- Container.java: Removed check for next != null.
- Display.java: Removed check for dest != null.
- CommonTransitions.java: Removed checks for sourceForm != null and dest != null.
- ResourceThreadQueue.java: Removed check for img == null.
- Other minor cleanup.
* Fix redundant nullcheck warnings from SpotBugs
- Remove redundant null checks in multiple files (Socket.java, Form.java, Component.java, etc.) where values are guaranteed to be non-null or null.
- Update `generate-quality-report.py` to enforce zero tolerance for `RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE` and `RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE` warnings.
- Fix compilation issues in Socket.java syntax.
- Verify that the build passes with the new quality gate.
* Fix redundant nullcheck warnings and enforce quality gate
- Update generate-quality-report.py to fail build on RCN_REDUNDANT_NULLCHECK violations.
- Remove redundant null checks in multiple files (Objects.java, Component.java, Form.java, etc.).
- Revert unsafe null check removal in Socket.java that caused test failures.
- Add suppression for Socket.java in spotbugs-exclude.xml.
- Cleanup dead code in DefaultLookAndFeel.java and Inflate.java.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent d010b3c commit f7f6ace
File tree
35 files changed
+92
-189
lines changed- .github/scripts
- CodenameOne/src/com/codename1
- compat/java/util
- io
- gzip
- l10n
- processing
- properties
- ui
- animations
- html
- layouts
- mig
- plaf
- spinner
- table
- tree
- util
- maven/core-unittests
35 files changed
+92
-189
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
757 | 774 | | |
758 | 775 | | |
759 | 776 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2747 | 2747 | | |
2748 | 2748 | | |
2749 | 2749 | | |
2750 | | - | |
2751 | | - | |
2752 | | - | |
2753 | 2750 | | |
2754 | 2751 | | |
2755 | 2752 | | |
| |||
2763 | 2760 | | |
2764 | 2761 | | |
2765 | 2762 | | |
2766 | | - | |
2767 | | - | |
2768 | | - | |
2769 | 2763 | | |
2770 | 2764 | | |
2771 | 2765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 154 | | |
159 | 155 | | |
160 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
525 | | - | |
526 | | - | |
| 524 | + | |
527 | 525 | | |
528 | 526 | | |
529 | 527 | | |
| |||
844 | 842 | | |
845 | 843 | | |
846 | 844 | | |
847 | | - | |
| 845 | + | |
848 | 846 | | |
849 | 847 | | |
850 | 848 | | |
| 849 | + | |
851 | 850 | | |
852 | 851 | | |
853 | 852 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 83 | | |
87 | 84 | | |
88 | 85 | | |
| |||
112 | 109 | | |
113 | 110 | | |
114 | 111 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 112 | | |
119 | 113 | | |
120 | 114 | | |
| |||
144 | 138 | | |
145 | 139 | | |
146 | 140 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 141 | | |
151 | 142 | | |
152 | 143 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
376 | | - | |
377 | | - | |
| 375 | + | |
378 | 376 | | |
379 | 377 | | |
380 | 378 | | |
| |||
Lines changed: 15 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
72 | 69 | | |
| 70 | + | |
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
| |||
193 | 191 | | |
194 | 192 | | |
195 | 193 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
205 | 200 | | |
206 | | - | |
| 201 | + | |
207 | 202 | | |
208 | 203 | | |
209 | 204 | | |
| |||
389 | 384 | | |
390 | 385 | | |
391 | 386 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 387 | + | |
| 388 | + | |
396 | 389 | | |
397 | 390 | | |
398 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
1274 | 1272 | | |
1275 | 1273 | | |
1276 | 1274 | | |
| |||
0 commit comments