MFAshby commented on code in PR #1309:
URL: https://github.com/apache/struts/pull/1309#discussion_r2286441992


##########
core/src/main/java/org/apache/struts2/factory/StrutsConverterFactory.java:
##########
@@ -18,31 +18,30 @@
  */
 package org.apache.struts2.factory;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.struts2.ObjectFactory;
 import org.apache.struts2.conversion.TypeConverter;
-import org.apache.struts2.inject.Container;
 import org.apache.struts2.inject.Inject;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
 
 import java.util.Map;
 
 /**
  * Default implementation
  */
 public class StrutsConverterFactory implements ConverterFactory {
-
     private static final Logger LOG = 
LogManager.getLogger(StrutsConverterFactory.class);
 
-    private Container container;
+    private ObjectFactory objectFactory;
 
     @Inject
-    public void setContainer(Container container) {
-        this.container = container;
+    public void setObjectFactory(ObjectFactory objectFactory) {
+        this.objectFactory = objectFactory;
     }
 
+    @Override
     public TypeConverter buildConverter(Class<? extends TypeConverter> 
converterClass, Map<String, Object> extraContext) throws Exception {
         LOG.debug("Creating converter of type [{}]", 
converterClass.getCanonicalName());
-        return container.inject(converterClass);
+        return (TypeConverter)objectFactory.buildBean(converterClass, 
extraContext);

Review Comment:
   This is incorrect, copilot. `objectFactory.buildBean` declares it's return 
type as `Object` so the cast is fully necessary for the code to compile.



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