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

ASF GitHub Bot commented on ARTEMIS-1395:
-----------------------------------------

GitHub user tabish121 opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1525

    ARTEMIS-1395 Clean up toString code

    Clean up toString code and properly log error message.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tabish121/activemq-artemis ARTEMIS-1395

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1525.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1525
    
----
commit 8dddc7370c9f2af1354d03fadc206c852d94077c
Author: Timothy Bish <[email protected]>
Date:   2017-09-08T16:44:07Z

    ARTEMIS-1395 Clean up toString code
    
    Clean up toString code and properly log error message.

----


> FindBugs: Dubious method used: System.exit() in CoreMessage#toString()
> ----------------------------------------------------------------------
>
>                 Key: ARTEMIS-1395
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1395
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.4.0
>         Environment: commit 53a9c9b47b8c64ff2c0f2c6be40a1cf5984e5e8b (HEAD -> 
> master, upstream/master)
> Merge: 49ef04b6f d2dcf1bba
> Author: Clebert Suconic <[email protected]>
> Date:   Wed Sep 6 10:30:13 2017 -0400
>     This closes #1513
>            Reporter: Jiri Danek
>            Priority: Trivial
>
> This is weird. Possibly some left over debugging code. I never saw this 
> actually crash Artemis, though. Still, I think it should be changed.
> {code}
> 1079   @Override
> 1080   public String toString() {
> 1081      try {
> 1082         checkProperties();
> 1083         return "CoreMessage[messageID=" + messageID + ",durable=" + 
> isDurable() + ",userID=" + getUserID() + ",priority=" + this.getPriority()  +
> 1084            ", timestamp=" + toDate(getTimestamp()) + ",expiration=" + 
> toDate(getExpiration()) +
> 1085            ", durable=" + durable + ", address=" + getAddress() + 
> ",properties=" + properties + "]@" + System.identityHashCode(this);
> 1086      } catch (Throwable e) {
> 1087         e.printStackTrace();
>       
> CID 1455427 (#1 of 1): Dm: Dubious method used (FB.DM_EXIT)
> 1. defect: 
> org.apache.activemq.artemis.core.message.impl.CoreMessage.toString() invokes 
> System.exit(...), which shuts down the entire virtual machine.
> 1088         System.exit(-1);
> 1089         return "ServerMessage[messageID=" + messageID + "]";
> 1090      }
> 1091   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to