Commit 7af2bce
authored
Fix SpotBugs UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR warnings (#4340)
* Fix SpotBugs UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR warnings and enforce rule.
Addressed multiple null dereference issues reported by SpotBugs across several files:
- CodenameOneImplementation.java: Added local variable assignment and null check for logger.
- NetworkManager.java: Added local variable assignment and null check for threadInstance.
- Tree.java: Added null checks for stat_desc.
- FontImage.java: Added null checks for fnt.
- Node.java: Added null checks for scene and camera.
- WebServiceProxyCall.java: Added null checks for def and arguments.
- PreferencesObject.java: Added null check for bo and propertyIndex.
- ShareService.java: Added null check for original form.
- Inflate.java: Added null checks for blocks.
- StyleParser.java: Added null check for color.
- CommonTransitions.java: Added null checks for timeline, buffer, motion, and motion2.
- XYMultiSeriesTransition.java: Added null check for seriesTransitions.
- AnimationObject.java: Added setTimeNotNull method and usage.
Updated .github/scripts/generate-quality-report.py to treat UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR as an error.
* Fix UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR SpotBugs warnings.
Added null checks to dereferenced fields in:
- CodenameOneImplementation.java
- NetworkManager.java
- Tree.java
- FontImage.java
- Node.java
- WebServiceProxyCall.java
- PreferencesObject.java
- ShareService.java
- Inflate.java
- StyleParser.java
- CommonTransitions.java
- XYMultiSeriesTransition.java
- XYSeriesTransition.java
- XYValueSeriesTransition.java
- XYChart.java
- AnimationObject.java
- Component.java
Updated .github/scripts/generate-quality-report.py to enforce this rule.
* Fix remaining SpotBugs UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR violations.
Addressed missed null checks in:
- RequestBuilder.java: Added null checks for response and list.
- DateSpinner.java: Added null check for day field.
This builds upon previous fixes to enforce the rule in CI.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 675f9f7 commit 7af2bce
File tree
26 files changed
+196
-96
lines changed- .github/scripts
- CodenameOne/src/com/codename1
- charts
- transitions
- views
- components
- facebook
- impl
- io
- gzip
- rest
- properties
- ui
- animations
- layouts
- plaf
- scene
- spinner
- util
26 files changed
+196
-96
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
| 762 | + | |
| 763 | + | |
763 | 764 | | |
764 | 765 | | |
765 | 766 | | |
| |||
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
90 | | - | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| |||
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
| 690 | + | |
690 | 691 | | |
691 | 692 | | |
692 | 693 | | |
| |||
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
150 | 157 | | |
151 | 158 | | |
152 | 159 | | |
| |||
177 | 184 | | |
178 | 185 | | |
179 | 186 | | |
180 | | - | |
| 187 | + | |
181 | 188 | | |
182 | 189 | | |
183 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
1295 | | - | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1296 | 1298 | | |
1297 | 1299 | | |
1298 | 1300 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5636 | 5636 | | |
5637 | 5637 | | |
5638 | 5638 | | |
5639 | | - | |
| 5639 | + | |
| 5640 | + | |
| 5641 | + | |
| 5642 | + | |
5640 | 5643 | | |
5641 | 5644 | | |
5642 | 5645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| |||
793 | 795 | | |
794 | 796 | | |
795 | 797 | | |
796 | | - | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
797 | 802 | | |
798 | 803 | | |
799 | 804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
| |||
512 | 513 | | |
513 | 514 | | |
514 | 515 | | |
| 516 | + | |
515 | 517 | | |
516 | 518 | | |
517 | 519 | | |
| |||
0 commit comments