[ 
https://issues.apache.org/jira/browse/QPID-7744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15968767#comment-15968767
 ] 

Lorenz Quack commented on QPID-7744:
------------------------------------

I don't know of a situation other than testing where this would occur.

This came about when I was looking for a way to inject messages directly into 
the broker in a test.
The easiest way seemed to be to create a {{ManageableMessage}} and use 
{{QueueManagingVirtualHost#publishMessage}} to inject it.

Another approach would have been to use {{Subject.doAs}} in the tests but I saw 
that the other places in the code cope just fine with a null user so I thought 
I simply make this part consistent with the others (and my testing code simpler 
in the process).

> [Java Broker] Fix NPE in AbstractVirtualHost$MessageHeaderImpl when there is 
> no user principal
> ----------------------------------------------------------------------------------------------
>
>                 Key: QPID-7744
>                 URL: https://issues.apache.org/jira/browse/QPID-7744
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>            Reporter: Lorenz Quack
>             Fix For: qpid-java-broker-7.0.0
>
>
> Currently, the broker produces a NullPointerException when 
> {{MessageHeaderImpl}} are instantiated while the subject does not have a 
> UserPrincipal.
> While this scenario should not occur outside of testing it is better to guard 
> against NPEs.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to