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:04:37 UTC

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

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

 ##########
 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:
   UncheckedIOException?

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