@Test public void testSetFieldsEmptyByteArray() throws Exception { StringPassResolver resolver = buildResolver(); byte[] empty = new byte[0]; List<OneField> record = Collections.singletonList(new OneField(DataType.BYTEA.getOID(), empty)); OneRow oneRow = resolver.setFields(record); assertNull(oneRow); }
@Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; } }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }  }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }  @Override List<OneField> getFields(OneRow onerow); @Override OneRow setFields(List<OneField> record); }
StringPassResolver extends BasePlugin implements Resolver { @Override public OneRow setFields(List<OneField> record) { OneField oneField = record.get(0); if ((oneField.val instanceof InputStream && resolveWriteCount > 0) || (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) { return null; } oneRow.setData(oneField.val); resolveWriteCount++; return oneRow; }  @Override List<OneField> getFields(OneRow onerow); @Override OneRow setFields(List<OneField> record);  }