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

ASF GitHub Bot commented on STORM-1269:
---------------------------------------

Github user hustfxj commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1185#discussion_r55002193
  
    --- Diff: storm-core/src/jvm/org/apache/storm/utils/Utils.java ---
    @@ -2302,4 +2302,54 @@ public Object call() {
         public static long bitXor(Long a, Long b) {
             return a ^ b;
         }
    +
    +    public static Integer parseInt(Object o) {
    +        if (o == null) {
    +            return null;
    +        }
    +
    +        if (o instanceof String) {
    +            return Integer.parseInt(String.valueOf(o));
    +        } else if (o instanceof Long) {
    +            long value = (Long) o;
    +            return (int) value;
    +        } else if (o instanceof Integer) {
    +            return (Integer) o;
    +        } else {
    +            throw new RuntimeException("Invalid value " + 
o.getClass().getName() + " " + o);
    +        }
    +    }
    +
    +    public static Integer parseInt(Object o, int defaultValue) {
    --- End diff --
    
    Utils has the methods . The name is getInt()


> port backtype.storm.daemon.common to java
> -----------------------------------------
>
>                 Key: STORM-1269
>                 URL: https://issues.apache.org/jira/browse/STORM-1269
>             Project: Apache Storm
>          Issue Type: New Feature
>          Components: storm-core
>            Reporter: Robert Joseph Evans
>            Assignee: Basti Liu
>              Labels: java-migration, jstorm-merger
>
> Common utils shared by the daemons (Some things should just use the Thrift 
> object)
> https://github.com/apache/storm/blob/jstorm-import/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java
>  is similar but not exactly the same.



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

Reply via email to