gnodet commented on PR #13636:
URL: https://github.com/apache/maven/pull/13636#issuecomment-6664251287
<!-- forgebot -->
Addressed all 5 issues from the latest review:
**1. `split(",", -1)` empty tokens** — switched to `split(",")` with
explicit empty-token filtering on both the array path (Stream + filter) and the
collection path (for-loop + trim + isEmpty check). Consecutive/trailing commas
and whitespace-only tokens are now dropped, preventing `NumberFormatException`
for numeric component types.
**2. `Object.class` as scalar** — leaf nodes (no children) still evaluate to
`String` as before; nodes with children now return `NOT_SCALAR` to fall through
to bean/map/collection conversion. This fixes the silent null for `Map<String,
Object>` with nested XML children.
**3. `<property>` with `<name>` but no `<value>`** — the else-branch now
only applies when `nameNode == null` (i.e. plain `<key>text</key>` style).
Malformed Plexus entries (`<name>` without `<value>`) are silently skipped
instead of inserting the literal string `"property"` as the key.
**4. `PlexusMojoExpressionEvaluatorAdapter` unchecked cast** — constructor
now takes `TypeAwareExpressionEvaluator` directly; the cast moved to the single
call site in `DefaultMavenPluginManager` where it is correct by construction.
**5. Missing tests** — added 5 new tests to `V4MojoConfiguratorTest`:
- `testCommaSeparatedArray` — basic comma-split for arrays
- `testCommaSeparatedArraySkipsEmptyTokens` — `"a,,b, ,c"` → `["a","b","c"]`
- `testCommaSeparatedList` — same for List
- `testPlexusStyleProperties` — full
`<property><name>k</name><value>v</value></property>` round-trip
- `testPlexusStylePropertyWithNameButNoValueIsSkipped` — malformed entry
produces empty Properties
63/63 tests green locally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]