You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/11/06 08:31:24 UTC
[GitHub] [calcite-avatica] sunjincheng121 commented on a change in pull request #161: [CALCITE-4877] Make the exception information more explicit for instantiate plugin.
sunjincheng121 commented on a change in pull request #161:
URL: https://github.com/apache/calcite-avatica/pull/161#discussion_r744099965
##########
File path: core/src/main/java/org/apache/calcite/avatica/AvaticaUtils.java
##########
@@ -235,10 +232,29 @@ public static Class box(Class clazz) {
} catch (NoSuchFieldException e) {
// ignore
}
+ assert pluginClass.isAssignableFrom(clazz);
Review comment:
+1 for your suggestion.
I do not want add assert here, just moved the position from up line to here . Agree with you, I do not like use assert to do the logical judgment. but I see that the project seems to favor to use assert. For example, in the following classes: `avaticaresultset`, `avaticasite`, `avaticaconnection`, `builtinconnectionproperty`, `connectionconfigimpl` etc.
Do you know any principles for using assert in this project? // I'm new to this project :)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org