[ 
https://issues.apache.org/jira/browse/STORM-2483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jacob Liu updated STORM-2483:
-----------------------------
    Description: 
org.apache.storm.utils.Utils#getGlobalStreamId has wrong parameters order:
    
public static GlobalStreamId getGlobalStreamId(String streamId, String 
componentId) {
        if (componentId == null) {
            return new GlobalStreamId(streamId, DEFAULT_STREAM_ID);
        }
        return new GlobalStreamId(streamId, componentId);
    }

but GlobalStreamId constructor is:   public GlobalStreamId(
    String componentId,
    String streamId)

so i think the nice code is:
    public static GlobalStreamId getGlobalStreamId(String streamId, String 
componentId) {
        if (streamId == null) {
            return new GlobalStreamId(componentId, DEFAULT_STREAM_ID);
        }
        return new GlobalStreamId(componentId, streamId);
    }


  was:
org.apache.storm.utils.Utils#getGlobalStreamId has wrong parameters order:
    
public static GlobalStreamId getGlobalStreamId(String streamId, String 
componentId) {
        if (componentId == null) {
            return new GlobalStreamId(streamId, DEFAULT_STREAM_ID);
        }
        return new GlobalStreamId(streamId, componentId);
    }

bug GlobalStreamId constructor is:   public GlobalStreamId(
    String componentId,
    String streamId)

so i think the nice code is:
    public static GlobalStreamId getGlobalStreamId(String streamId, String 
componentId) {
        if (streamId == null) {
            return new GlobalStreamId(componentId, DEFAULT_STREAM_ID);
        }
        return new GlobalStreamId(componentId, streamId);
    }



> wrong parameters order
> ----------------------
>
>                 Key: STORM-2483
>                 URL: https://issues.apache.org/jira/browse/STORM-2483
>             Project: Apache Storm
>          Issue Type: Bug
>          Components: storm-core
>    Affects Versions: 1.0.3
>         Environment: storm-core:1.0.3
>            Reporter: Jacob Liu
>
> org.apache.storm.utils.Utils#getGlobalStreamId has wrong parameters order:
>     
> public static GlobalStreamId getGlobalStreamId(String streamId, String 
> componentId) {
>         if (componentId == null) {
>             return new GlobalStreamId(streamId, DEFAULT_STREAM_ID);
>         }
>         return new GlobalStreamId(streamId, componentId);
>     }
> but GlobalStreamId constructor is:   public GlobalStreamId(
>     String componentId,
>     String streamId)
> so i think the nice code is:
>     public static GlobalStreamId getGlobalStreamId(String streamId, String 
> componentId) {
>         if (streamId == null) {
>             return new GlobalStreamId(componentId, DEFAULT_STREAM_ID);
>         }
>         return new GlobalStreamId(componentId, streamId);
>     }



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to