From a4385eb122e0f0eb6f504d2fcdf91b0e7c10934c Mon Sep 17 00:00:00 2001 From: Dylan Hutchison Date: Thu, 11 Aug 2016 23:52:26 -0700 Subject: [PATCH] Format --- .../myria/operator/BinaryFileScan.java | 2 +- .../escience/myria/operator/FileScan.java | 3 +-- .../myria/operator/BinaryFileScanTest.java | 21 ++++++++++++------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/edu/washington/escience/myria/operator/BinaryFileScan.java b/src/edu/washington/escience/myria/operator/BinaryFileScan.java index 49db9d496..37284653b 100644 --- a/src/edu/washington/escience/myria/operator/BinaryFileScan.java +++ b/src/edu/washington/escience/myria/operator/BinaryFileScan.java @@ -91,7 +91,7 @@ protected final TupleBatch fetchNextReady() throws DbException { break; default: throw new UnsupportedOperationException( - "BinaryFileScan does not support the type "+schema.getColumnType(count)); + "BinaryFileScan does not support the type " + schema.getColumnType(count)); } building = true; } diff --git a/src/edu/washington/escience/myria/operator/FileScan.java b/src/edu/washington/escience/myria/operator/FileScan.java index aa175cf63..5d276089e 100644 --- a/src/edu/washington/escience/myria/operator/FileScan.java +++ b/src/edu/washington/escience/myria/operator/FileScan.java @@ -206,8 +206,7 @@ protected TupleBatch fetchNextReady() throws DbException, IOException { switch (schema.getColumnType(column)) { case BOOLEAN_TYPE: Float f = Floats.tryParse(cell); - if (f != null) - buffer.putBoolean(column, f != 0); + if (f != null) buffer.putBoolean(column, f != 0); else if (BooleanUtils.toBoolean(cell)) buffer.putBoolean(column, Boolean.parseBoolean(cell)); break; diff --git a/test/edu/washington/escience/myria/operator/BinaryFileScanTest.java b/test/edu/washington/escience/myria/operator/BinaryFileScanTest.java index f5708b9df..66cf38e27 100644 --- a/test/edu/washington/escience/myria/operator/BinaryFileScanTest.java +++ b/test/edu/washington/escience/myria/operator/BinaryFileScanTest.java @@ -112,10 +112,15 @@ public void testNumRowsFromCosmo24Star() throws DbException { @Test public void testGenerateReadBinary() throws Exception { - Schema schema = new Schema(ImmutableList.of( // one of each - Type.BOOLEAN_TYPE, Type.DOUBLE_TYPE, Type.FLOAT_TYPE, Type.INT_TYPE, - Type.LONG_TYPE, Type.STRING_TYPE - )); + Schema schema = + new Schema( + ImmutableList.of( // one of each + Type.BOOLEAN_TYPE, + Type.DOUBLE_TYPE, + Type.FLOAT_TYPE, + Type.INT_TYPE, + Type.LONG_TYPE, + Type.STRING_TYPE)); byte[] buf; { ByteArrayOutputStream bos = new ByteArrayOutputStream(1000); @@ -147,7 +152,8 @@ private void generateBinaryFile(String filename, Type[] typeAr, int numrows) { * @param stream The data stream to write data to. Does not close the stream. */ @SuppressWarnings("unused") - private void generateBinaryData(DataOutputStream stream, Type[] typeAr, int numrows) throws IOException { + private void generateBinaryData(DataOutputStream stream, Type[] typeAr, int numrows) + throws IOException { for (int i = 0; i < numrows; i++) { for (Type element : typeAr) { switch (element) { @@ -167,11 +173,10 @@ private void generateBinaryData(DataOutputStream stream, Type[] typeAr, int numr stream.writeLong(i); break; case STRING_TYPE: - stream.writeUTF("string"+i); + stream.writeUTF("string" + i); break; default: - throw new UnsupportedOperationException( - "can only write fix length field to bin file"); + throw new UnsupportedOperationException("can only write fix length field to bin file"); } } }