Github user lewismc commented on a diff in the pull request:
https://github.com/apache/gora/pull/32#discussion_r38287924
--- Diff:
gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
---
@@ -248,7 +247,6 @@ public K fromBytes(Class<K> clazz, byte[] val) {
avroEncoder.flush();
return baos.toByteArray();
} catch (IOException e) {
- e.printStackTrace();
--- End diff --
Hi @renato2099 actually, I think the answer is no. We should not be
printing an exception here. I _think_ the logic may be flawed.
We make a check in the code for the object being null (in which case we
call firstNullSchemaTypeIndex and then process with the avro encoder) or the
alternative which is that the object is not null (in which case we call
firstNotNullSchemaTypeIndex and then process with the avro encoder).
This method is recursive.
If you look at the very last else statement
```
} else {
return toBytes(o);
}
```
this throws no logging error or stack trace exception right? I think that
this logic is OK. It was wrong in the first place.
* to throw an exception would mean that the recursive code could never be
called.
* to log an error would be useless and what other state can the object be
in other than either 'null' or 'not null', in which case it has already been
processed by the preceding statements!
wdyt. Thank you for review.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---