Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-4749

SIMILAR_BRANCHES.SWITCH in ../activemq/artemis/utils/ThreadDumpUtil.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.25.0
    • 2.34.0
    • None
    • None

    Description

      The static analyzer has detected SIMILAR_BRANCHES.SWITCH: we have identical branches in switch node in [private static String threadInfoToString] https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ThreadDumpUtil.java#L106-L113
       

       

      It seems better to change code this way: 

       

      case WAITING:

      case TIMED_WAITING:
                        sb.append("\t-  waiting on " + threadInfo.getLockInfo());
                        sb.append('\n');
                        break;

                     default:

       

      Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.

      Author E. Bykhanova (e.bykhanova@fobos-nt.ru).

      Attachments

        1. image-2024-05-01-13-29-32-686.png
          417 kB
          e.bykhanova
        2. image-2024-05-01-13-30-38-262.png
          238 kB
          e.bykhanova

        Issue Links

          Activity

            People

              jbertram Justin Bertram
              ellena13 e.bykhanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m