You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2025/10/27 14:47:00 UTC
[jira] [Assigned] (ARTEMIS-4932) Reference, returned from function 'defaultFactory.getScheme()String' at URISchema.java:53, may be null and is dereferenced at URISchema.java:53.
[ https://issues.apache.org/jira/browse/ARTEMIS-4932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Bertram reassigned ARTEMIS-4932:
---------------------------------------
Assignee: Justin Bertram
> 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
> Assignee: Justin Bertram
> 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: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact