[ 
https://issues.apache.org/jira/browse/ARTEMIS-5863?focusedWorklogId=1002247&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1002247
 ]

ASF GitHub Bot logged work on ARTEMIS-5863:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Jan/26 13:30
            Start Date: 28/Jan/26 13:30
    Worklog Time Spent: 10m 
      Work Description: gtully commented on code in PR #6199:
URL: https://github.com/apache/artemis/pull/6199#discussion_r2736651704


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java:
##########
@@ -1105,10 +1105,12 @@ private void export(BeanUtilsBean beanUtils, 
Stack<String> nested, BufferedWrite
                stream = stream.filter((Map.Entry<?, ?> entry)-> 
filterOn.isAssignableFrom(entry.getClass()));
             }
             stream.forEach(entry -> {
-               // nested by name
-               nested.push(entry.getKey().toString());
-               export(beanUtils, nested, bufferedWriter, entry.getValue());
-               nested.pop();
+               if (entry.getValue() != null) {

Review Comment:
   this is inconsistent. the check for null to not export a key with for a null 
value
   
   and the use of String.ValueOf that will write key="null" for a null value.
   
   we should be consistent and write key= for null values and not introduce 
"null" as we don't understand that as a config value.
   This means we need to check for a null value and write an empty string '' 





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1002247)
    Time Spent: 50m  (was: 40m)

> Configuration export as properties would throw NPE for invalid acceptor URIs
> ----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5863
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5863
>             Project: Artemis
>          Issue Type: Bug
>    Affects Versions: 2.50.0
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.51.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> say you specify the following URI:
>       configuration.addAcceptorConfiguration("test", 
> "tcp://0.0.0.0:61616?useKQueue");
> useKQueue would generate a null value on the HashMap, which would throw a NPE 
> during export.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to