stone-98 commented on pull request #9111:
URL: https://github.com/apache/dubbo/pull/9111#issuecomment-952064468
For the Converter interface, if I could go from sourceType to targetType, it
certain can be convert from targetType to sourceType. But the Converter
interface does not support it. In fact, there are corresponding application
scenarios,For example, RpcUtils transforms timeout.
```java
private static long convertToNumber(Object obj, long defaultTimeout) {
long timeout = 0;
try {
if (obj instanceof String) {
timeout = Long.parseLong((String) obj);
} else if (obj instanceof Number) {
timeout = ((Number) obj).longValue();
} else {
timeout = Long.parseLong(obj.toString());
}
} catch (Exception e) {
// ignore
}
return timeout;
}
```
By the way, there is a bug that the defaultTimeout does not take effect.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]