You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Martin Ritchie (JIRA)" <qp...@incubator.apache.org> on 2007/02/12 11:52:05 UTC

[jira] Created: (QPID-363) AMQProtocolSession allows getChannel to return null

AMQProtocolSession allows getChannel to return null
---------------------------------------------------

                 Key: QPID-363
                 URL: https://issues.apache.org/jira/browse/QPID-363
             Project: Qpid
          Issue Type: Bug
            Reporter: Martin Ritchie


    /**
     * Get the channel for this session associated with the specified id. A channel
     * id is unique per connection (i.e. per session).
     * @param channelId the channel id which must be valid
     * @return null if no channel exists, the channel otherwise
     */
    AMQChannel getChannel(int channelId) throws AMQException;

Most usages of getChannel don't check return and do channel.get resulting in possible NPE. in failed case. some cases simply threw new AMQEx if it is null. 

Why not change getChannel to throw AMQex rather than returning null?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (QPID-363) AMQProtocolSession allows getChannel to return null

Posted by "Martin Ritchie (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Ritchie updated QPID-363:
--------------------------------

    Component/s: Java Broker

> AMQProtocolSession allows getChannel to return null
> ---------------------------------------------------
>
>                 Key: QPID-363
>                 URL: https://issues.apache.org/jira/browse/QPID-363
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>            Reporter: Martin Ritchie
>
>     /**
>      * Get the channel for this session associated with the specified id. A channel
>      * id is unique per connection (i.e. per session).
>      * @param channelId the channel id which must be valid
>      * @return null if no channel exists, the channel otherwise
>      */
>     AMQChannel getChannel(int channelId) throws AMQException;
> Most usages of getChannel don't check return and do channel.get resulting in possible NPE. in failed case. some cases simply threw new AMQEx if it is null. 
> Why not change getChannel to throw AMQex rather than returning null?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (QPID-363) AMQProtocolSession allows getChannel to return null

Posted by "Suran Jayathilaka (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suran Jayathilaka updated QPID-363:
-----------------------------------

    Attachment: qpid-363.diff

Changed AMQMinaProtocolSession's getChannel() to throws an AMQException instead of returning null.

> AMQProtocolSession allows getChannel to return null
> ---------------------------------------------------
>
>                 Key: QPID-363
>                 URL: https://issues.apache.org/jira/browse/QPID-363
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>            Reporter: Martin Ritchie
>             Fix For: M3
>
>         Attachments: qpid-363.diff
>
>
>     /**
>      * Get the channel for this session associated with the specified id. A channel
>      * id is unique per connection (i.e. per session).
>      * @param channelId the channel id which must be valid
>      * @return null if no channel exists, the channel otherwise
>      */
>     AMQChannel getChannel(int channelId) throws AMQException;
> Most usages of getChannel don't check return and do channel.get resulting in possible NPE. in failed case. some cases simply threw new AMQEx if it is null. 
> Why not change getChannel to throw AMQex rather than returning null?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (QPID-363) AMQProtocolSession allows getChannel to return null

Posted by "Aidan Skinner (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aidan Skinner updated QPID-363:
-------------------------------

    Priority: Minor  (was: Major)

It's not clear that this should be done

> AMQProtocolSession allows getChannel to return null
> ---------------------------------------------------
>
>                 Key: QPID-363
>                 URL: https://issues.apache.org/jira/browse/QPID-363
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>            Reporter: Martin Ritchie
>            Priority: Minor
>             Fix For: M3
>
>         Attachments: qpid-363.diff
>
>
>     /**
>      * Get the channel for this session associated with the specified id. A channel
>      * id is unique per connection (i.e. per session).
>      * @param channelId the channel id which must be valid
>      * @return null if no channel exists, the channel otherwise
>      */
>     AMQChannel getChannel(int channelId) throws AMQException;
> Most usages of getChannel don't check return and do channel.get resulting in possible NPE. in failed case. some cases simply threw new AMQEx if it is null. 
> Why not change getChannel to throw AMQex rather than returning null?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (QPID-363) AMQProtocolSession allows getChannel to return null

Posted by "Martin Ritchie (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Ritchie updated QPID-363:
--------------------------------

    Fix Version/s: M3

> AMQProtocolSession allows getChannel to return null
> ---------------------------------------------------
>
>                 Key: QPID-363
>                 URL: https://issues.apache.org/jira/browse/QPID-363
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>            Reporter: Martin Ritchie
>             Fix For: M3
>
>
>     /**
>      * Get the channel for this session associated with the specified id. A channel
>      * id is unique per connection (i.e. per session).
>      * @param channelId the channel id which must be valid
>      * @return null if no channel exists, the channel otherwise
>      */
>     AMQChannel getChannel(int channelId) throws AMQException;
> Most usages of getChannel don't check return and do channel.get resulting in possible NPE. in failed case. some cases simply threw new AMQEx if it is null. 
> Why not change getChannel to throw AMQex rather than returning null?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (QPID-363) AMQProtocolSession allows getChannel to return null

Posted by "Marnie McCormack (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marnie McCormack updated QPID-363:
----------------------------------

    Fix Version/s:     (was: M4)

Moving items not being worked on afaik out of M4 Fix Version

> AMQProtocolSession allows getChannel to return null
> ---------------------------------------------------
>
>                 Key: QPID-363
>                 URL: https://issues.apache.org/jira/browse/QPID-363
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>            Reporter: Martin Ritchie
>            Assignee: Martin Ritchie
>            Priority: Minor
>         Attachments: qpid-363.diff
>
>
>     /**
>      * Get the channel for this session associated with the specified id. A channel
>      * id is unique per connection (i.e. per session).
>      * @param channelId the channel id which must be valid
>      * @return null if no channel exists, the channel otherwise
>      */
>     AMQChannel getChannel(int channelId) throws AMQException;
> Most usages of getChannel don't check return and do channel.get resulting in possible NPE. in failed case. some cases simply threw new AMQEx if it is null. 
> Why not change getChannel to throw AMQex rather than returning null?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.