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 16:32:11 UTC

[GitHub] [calcite-avatica] asolimando commented on a change in pull request #161: [CALCITE-4877] Make the exception information more explicit for instantiate plugin.

asolimando commented on a change in pull request #161:
URL: https://github.com/apache/calcite-avatica/pull/161#discussion_r744143347



##########
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:
       My rule of thumb is to use assertions for situations that should never happen, it's more of a "documentation" for me where I state expectations that follow logically but are maybe not evident, all the other cases need checks+exception




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