Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3451

FP in S2095: sessions, producers, and consumers of a closed connection with JMS 2.0.

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.7
    • Component/s: Symbolic Execution
    • Labels:
      None

      Description

      According to the documentation: Connection.html#close:
      There is no need to close the sessions, producers, and consumers of a closed connection.

      try (javax.jms.Connection conn = connFactory.createConnection()){
                  Session sess = conn.createSession(); // FP
                  MessageProducer producer = sess.createProducer(taskQueue); // FP
                  ObjectMessage msg = sess.createObjectMessage();
                  msg.setObject(t);
                  producer.send(msg);
              }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quentin.jaquier Quentin Jaquier
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: