gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-429) Implement Maven forbidden-apis plugin in Gora
Date Mon, 31 Aug 2015 06:50:47 GMT

    [ https://issues.apache.org/jira/browse/GORA-429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14723048#comment-14723048
] 

ASF GitHub Bot commented on GORA-429:
-------------------------------------

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. 


> Implement Maven forbidden-apis plugin in Gora
> ---------------------------------------------
>
>                 Key: GORA-429
>                 URL: https://issues.apache.org/jira/browse/GORA-429
>             Project: Apache Gora
>          Issue Type: Improvement
>          Components: build process
>            Reporter: Lewis John McGibbney
>            Assignee: Lewis John McGibbney
>             Fix For: 0.6.1
>
>
> The [forbidden-apis Maven plugin|https://github.com/policeman-tools/forbidden-apis] allow
us to parse Java byte code to find invocations of method/class/field signatures and fail build




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message