[
https://issues.apache.org/jira/browse/ARTEMIS-5115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17916124#comment-17916124
]
ASF subversion and git services commented on ARTEMIS-5115:
----------------------------------------------------------
Commit a3fc1ff7fe6b68b072f0a54a59ca097f684b538f in activemq-artemis's branch
refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=a3fc1ff7fe ]
ARTEMIS-5115 remove needless null checks in ChannelImpl
The `connection` variable is used liberally throughout `ChannelImpl` and
it is never set to `null`. Therefore, it should never be `null` and we
can dispense with unnecessary checks for `null`.
> deref after NULL in ChannelImpl.java
> ------------------------------------
>
> Key: ARTEMIS-5115
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5115
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Alex
> Assignee: Justin Bertram
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> In the {{clearUpTo}} method packages are cleared one at a time to the
> specified command ID. If the logger is enabled, information about
> {{RemotingConnectionID}}, {{lastReceived}}, {{commandId}}, and other data is
> displayed. In the first {{if}} the correct ternary operator is written which
> checks {{connection == null}}.
> Below in the loop is [another
> {{if}}|[https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L874-L875]],
> where there is no check for null which can lead to a
> {{NullPointerException}}.
> [https://github.com/apache/activemq-artemis/blob/4c6cded2e79cf10d2323de1b5fa7418b289ab034/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java#L856-L886]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact