Commit 5a4971f
committed
AXIS2-6074 Return null for empty enum values instead of throwing
When an empty XML element is sent for an enum field (e.g., <eventType/>),
the generated fromValue() method looked up the empty string in the enum
table, got null, and threw IllegalArgumentException. This caused a
cryptic SOAP fault ("unknown") with null HTTP status.
Fix: in both bean and helpermode templates, allow null/empty values to
return null from fromValue() instead of throwing. The bean template
previously had this guard only for string property types — now it
applies to all types. The helpermode template had no guard at all.
This restores the Axis2 1.6 behavior where empty enum elements were
handled gracefully.1 parent bfd03e4 commit 5a4971f
2 files changed
Lines changed: 4 additions & 2 deletions
File tree
- modules/adb-codegen/src/org/apache/axis2/schema/template
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1811 | 1811 | | |
1812 | 1812 | | |
1813 | 1813 | | |
1814 | | - | |
| 1814 | + | |
| 1815 | + | |
1815 | 1816 | | |
1816 | 1817 | | |
1817 | 1818 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
| 257 | + | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| |||
0 commit comments