[ 
https://issues.apache.org/jira/browse/WW-5536?focusedWorklogId=997490&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-997490
 ]

ASF GitHub Bot logged work on WW-5536:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Dec/25 10:16
            Start Date: 23/Dec/25 10:16
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart commented on code in PR #1405:
URL: https://github.com/apache/struts/pull/1405#discussion_r2642683949


##########
core/src/main/java/org/apache/struts2/ognl/XWorkTypeConverterWrapper.java:
##########
@@ -36,6 +37,11 @@ public XWorkTypeConverterWrapper(ognl.TypeConverter conv) {
 
     @Override
     public Object convertValue(Map context, Object target, Member member, 
String propertyName, Object value, Class toType) {
-        return typeConverter.convertValue(context, target, member, 
propertyName, value, toType);
+        // Cast context to OgnlContext for OGNL 3.4.8+ compatibility
+        OgnlContext ognlContext = (context instanceof OgnlContext oc) ? oc : 
null;
+        if (ognlContext == null) {
+            throw new IllegalArgumentException("Context must be an OgnlContext 
for OGNL 3.4.8+");
+        }
+        return typeConverter.convertValue(ognlContext, target, member, 
propertyName, value, toType);

Review Comment:
   Refactored





Issue Time Tracking
-------------------

    Worklog Id:     (was: 997490)
    Time Spent: 2h  (was: 1h 50m)

> Bump ognl:ognl from 3.3.5 to 3.4.8
> ----------------------------------
>
>                 Key: WW-5536
>                 URL: https://issues.apache.org/jira/browse/WW-5536
>             Project: Struts 2
>          Issue Type: Dependency
>          Components: Core
>    Affects Versions: 6.7.0, 7.0.0
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.2.0
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to