Commit 2225fd3
Fix parameter validation in ApplicationDescriptorDTO, IsolatedClassLoader, and ServiceRegistryImpl
Issue #81: ApplicationDescriptorDTO permission conversion doesn't validate null fields
- Location: toSecurityConfig() method
- Problem: Created Permission objects without validating DTO fields are non-null
- Fix: Added validation for path, host, actions, and permission names
- Impact: Clear error messages instead of NPE when config has null values
Issue #80: IsolatedClassLoader.create() doesn't validate parameters
- Location: static factory method create()
- Problem: No validation of applicationId, descriptor, or platformSharedLoader
- Fix: Added Objects.requireNonNull() for all three parameters
- Impact: Fails fast with clear message instead of NPE deep in factory method
Issue #79: ServiceRegistryImpl methods don't validate parameters
- Location: getService(), getAllServices(), unregisterService()
- Problem: JavaDoc claimed NPE would be thrown but no validation present
- Fix: Added Objects.requireNonNull() for all parameters
- Impact: Contract fulfilled, clearer error messages
All fixes follow defensive programming pattern:
- Validate early (fail fast)
- Clear error messages indicating which parameter was null
- Consistent with existing validation patterns in codebase
Fixes: #81, #80, #79
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 857349d commit 2225fd3
3 files changed
Lines changed: 26 additions & 0 deletions
File tree
- jplatform-classloader/src/main/java/org/flossware/jplatform/classloader
- jplatform-config/src/main/java/org/flossware/jplatform/config
- jplatform-messaging/src/main/java/org/flossware/jplatform/messaging
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
203 | 209 | | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
207 | 213 | | |
208 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
214 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
215 | 230 | | |
216 | 231 | | |
217 | 232 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
| 131 | + | |
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
| |||
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| |||
0 commit comments