sigee commented on code in PR #276:
URL: https://github.com/apache/commons-beanutils/pull/276#discussion_r1742836993
##########
src/main/java/org/apache/commons/beanutils2/BeanUtilsBean.java:
##########
@@ -172,6 +172,22 @@ public BeanUtilsBean(final ConvertUtilsBean
convertUtilsBean,
this.propertyUtilsBean = propertyUtilsBean;
}
+ /**
+ * <p>Constructs an instance using given property, conversion instances
and log for logging.</p>
+ *
+ * @param convertUtilsBean use this {@code ConvertUtilsBean}
+ * to perform conversions from one object to another
+ * @param propertyUtilsBean use this {@code PropertyUtilsBean}
+ * to access properties
+ * @param log use this {@code Log}
+ * to appoint logging
+ */
+ public BeanUtilsBean(final ConvertUtilsBean convertUtilsBean, final
PropertyUtilsBean propertyUtilsBean, final Log log) {
+ this.convertUtilsBean = convertUtilsBean;
+ this.propertyUtilsBean = propertyUtilsBean;
+ LOG = log;
Review Comment:
Not every time. The original constructors have not changed, they do not edit
the global LOG. But you have to have some edit option if you want to inject
dependency for mocking. It could be a constructor or a setter. For my PoC this
was easyer, but as I said, not my best work. It could be much better if someone
have time to really think about the solution. Unfortunately I can't work on it
now, because I only have my phone for 2 weeks as technology.
--
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]