lukaszlenart opened a new pull request, #1878:
URL: https://github.com/apache/struts/pull/1878

   Backport of [#1873](https://github.com/apache/struts/pull/1873) to the 6.x 
line.
   
   When `XWorkConverter` cannot convert a value it returns the marker string 
`NO_CONVERSION_POSSIBLE`
   (`"ognl.NoConversionPossible"`). `XWorkMapPropertyAccessor` and 
`XWorkListPropertyAccessor` stored that
   marker straight into the target collection, so a `Map<Long, Integer>` could 
be left holding the marker
   `String` — under a `String` key, when the *key* was the unconvertible half — 
and the next read of that
   collection failed with a `ClassCastException` far from the cause. The 
accessors now skip the assignment
   and log at debug instead.
   
   Verified affected on 6.x before fixing: all four tests below fail on 
`support/struts-6-x-x` with
   `ognl.NoConversionPossible` found in the typed collection, and pass with the 
fix.
   
   - `XWorkMapPropertyAccessorTest` — value half and key half
   - `XWorkListPropertyAccessorTest` — indexed element
   - `ParametersInterceptorTest` — end to end through parameter binding, using 
the real-world trigger
     (an unchecked `s:checkbox` with `submitUnchecked="true"` submits `"false"` 
into a `Map<Long, Integer>`)
   
   `XWorkCollectionPropertyAccessor` is deliberately left alone, as on `main`: 
its scalar `setProperty` is
   not reachable through the value stack, so no failing test can be written for 
it.
   
   Full `core` suite green: 2721 tests, 0 failures.
   
   Fixes [WW-5700](https://issues.apache.org/jira/browse/WW-5700)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to