[
https://issues.apache.org/jira/browse/ARTEMIS-4932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Justin Bertram resolved ARTEMIS-4932.
-------------------------------------
Fix Version/s: 2.44.0
Resolution: Fixed
> Reference, returned from function 'defaultFactory.getScheme()String' at
> URISchema.java:53, may be null and is dereferenced at URISchema.java:53.
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-4932
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4932
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.25.0
> Reporter: Suhov Roman
> Priority: Major
> Fix For: 2.44.0
>
> Attachments: 1.png
>
>
> A problem has been detected in the {{URISchema.java}} file on line 53 and 70.
> In a call to the {{getScheme()}} method on a {{defaultFactory}} object,
> {{getScheme()}} may return {{null}} which will throw a
> {{NullPointerException}} when {{equals()}} is called.
> To avoid a {{NullPointerException}}, you should check the result of
> {{getScheme()}} for {{null}} before calling {{equals()}}, e.g.:
> {code:java}
> if (defaultFactory != null && uri.getHost() == null) {
> String defaultScheme = defaultFactory.getScheme();
> if (defaultScheme != null && defaultScheme.equals(uri.getScheme())) {
> uri = defaultFactory;
> }
> }{code}
>
--
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