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 2019/03/04 14:30:28 UTC

[GitHub] [calcite] zabetak commented on a change in pull request #1080: [CALCITE-2887] Improve performance of RexLiteral#toJavaString

zabetak commented on a change in pull request #1080: [CALCITE-2887] Improve performance of RexLiteral#toJavaString
URL: https://github.com/apache/calcite/pull/1080#discussion_r262080652
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexLiteral.java
 ##########
 @@ -551,12 +552,16 @@ private static int width(TimeUnit timeUnit) {
    * Prints the value this literal as a Java string constant.
    */
   public void printAsJava(PrintWriter pw) {
-    printAsJava(value, pw, typeName, true, RexDigestIncludeType.NO_TYPE);
+    try {
+      appendAsJava(value, pw, typeName, true, RexDigestIncludeType.NO_TYPE);
+    } catch (IOException e) {
+      throw new IllegalStateException("IOException should not be raised with PrintWriter", e);
 
 Review comment:
   Passing a PrintWriter should not raise an IOException, that's why I preferred IllegalState in this part.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services