You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2018/10/06 16:27:45 UTC

[GitHub] spark pull request #22637: [SPARK-25408] Move to more ideomatic Java8

Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22637#discussion_r223187058
  
    --- Diff: sql/catalyst/src/test/java/org/apache/spark/sql/catalyst/expressions/RowBasedKeyValueBatchSuite.java ---
    @@ -152,31 +151,27 @@ public void emptyBatch() throws Exception {
             // Expected exception; do nothing.
           }
           Assert.assertFalse(batch.rowIterator().next());
    -    } finally {
    -      batch.close();
         }
       }
     
       @Test
    -  public void batchType() throws Exception {
    -    RowBasedKeyValueBatch batch1 = RowBasedKeyValueBatch.allocate(keySchema,
    -            valueSchema, taskMemoryManager, DEFAULT_CAPACITY);
    -    RowBasedKeyValueBatch batch2 = RowBasedKeyValueBatch.allocate(fixedKeySchema,
    -            valueSchema, taskMemoryManager, DEFAULT_CAPACITY);
    -    try {
    -      Assert.assertEquals(batch1.getClass(), VariableLengthRowBasedKeyValueBatch.class);
    -      Assert.assertEquals(batch2.getClass(), FixedLengthRowBasedKeyValueBatch.class);
    -    } finally {
    -      batch1.close();
    -      batch2.close();
    +  public void batchType() {
    +    try (RowBasedKeyValueBatch batch1 = RowBasedKeyValueBatch.allocate(keySchema,
    +        valueSchema, taskMemoryManager, DEFAULT_CAPACITY);
    --- End diff --
    
    There's a compile error here. But note you can have multiple Closeables declared in one try block anyway, so these can be merged.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org