gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewismc <...@git.apache.org>
Subject [GitHub] gora pull request: GORA-429 Implement Maven forbidden-apis plugin ...
Date Mon, 31 Aug 2015 06:50:39 GMT
Github user lewismc commented on a diff in the pull request:

    --- 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) {
             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
    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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message