Aaaahhh geee, Thanks for finding that. We actually had it in a working version, but changed it to that as it was reported by warnings in the ide. Guess we should add a note to that code to not apply the quick fix, as this breaks Java 8 compatability.
Thanks for testing this. Chris ________________________________ From: 杨 林 <[email protected]> Sent: Wednesday, January 26, 2022 4:12:08 AM To: [email protected] <[email protected]> Subject: 回复: [DISCUSS] Remove commons-beanutils dependency Hi Chris, The PR (https://github.com/apache/plc4x/commit/deb42b720c1e181d87bfdad05c451209e32187e5) is still not working with Android, I have submitted a new one, could you please look at it (https://github.com/apache/plc4x/pull/307) Yang Lin 发件人: 杨 林<mailto:[email protected]> 发送时间: 2022年1月22日 19:45 收件人: [email protected]<mailto:[email protected]> 主题: 回复: [DISCUSS] Remove commons-beanutils dependency Yes, It should be decoded first, I’m missing that. Yang Lin 从 Windows 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>发送 发件人: Christofer Dutz<mailto:[email protected]> 发送时间: 2022年1月21日 21:51 收件人: [email protected]<mailto:[email protected]> 主题: RE: [DISCUSS] Remove commons-beanutils dependency I just had a look and added a review. If you want, I've slight tweaked your version and am currently running the test-suite. As soon as that's done I could propose a little change. Chris -----Original Message----- From: Christofer Dutz <[email protected]> Sent: Freitag, 21. Januar 2022 14:04 To: [email protected] Subject: RE: [DISCUSS] Remove commons-beanutils dependency Hi Yang ... Thanks for that. For some reason I didn't see any notifications about that ... I'll look into it right away. Thank you very much. Chris -----Original Message----- From: 杨 林 <[email protected]> Sent: Freitag, 21. Januar 2022 13:41 To: [email protected] Subject: 回复: [DISCUSS] Remove commons-beanutils dependency Hi Chris, The PR is submitted two days ago, https://github.com/apache/plc4x/pull/305. I think it’s better to minimize library dependency, expecially the library is only used in one place. Yang Lin 发件人: Christofer Dutz<mailto:[email protected]> 发送时间: 2022年1月21日 19:17 收件人: [email protected]<mailto:[email protected]> 主题: RE: [DISCUSS] Remove commons-beanutils dependency But I agree with Yang, The fix should be trivial and I would really be happy if we got a PR from him :-) Chris -----Original Message----- From: Sebastian Rühl <[email protected]> Sent: Freitag, 21. Januar 2022 11:01 To: [email protected] Subject: Re: [DISCUSS] Remove commons-beanutils dependency Hi Yang, could you please try bring that issue up to the upstream project? We don't want to replicate this logic in PLC4X if this can be solved upstream (at common-beanutils). Maybe there is a alternative implementation for java pojos that I'am currently not aware of. Other than that it's better to use methods supplied by org.apache.commons.lang3.reflect.FieldUtils rather than doing the direct implementation like you suggested. - Sebastian On 2022/01/19 12:54:22 杨 林 wrote: > Hi all, > > I’m using plc4j in Android, commons-beanutils is the only thing to obstacle > me to do that ,because Android does not have java.beans.PropertyDescriptor. > > org.apache.commons.beanutils.BeanUtils is used only in > org.apache.plc4x.java.spi.configuration.ConfigurationFactory (Line 93 and > Line 103). I think It could be replace by simple reflect: > > field.setAccessible(true); > > if (field.getType() == String.class) { > field.set(instance, valueString); > } else if ((field.getType() == boolean.class) || (field.getType() == > Boolean.class)) { > field.setBoolean(instance, Boolean.parseBoolean(valueString)); > } else if … > > Any help? > > Yang Lin >
