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

S2095: ignore org.jgroups.JChannel

    Details

    • Type: False-Positive
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 6.2
    • Component/s: Rules, Symbolic Execution
    • Labels:
      None

      Description

      RSPEC-2095 should ignore org.jgroups.JChannel as this class is designed to be opened during application lifetime (see example).

      public class Example {
      
          private volatile JChannel channel;
      
          public void init(final String configuration) throws Exception {
              this.channel = openChannel(configuration);
          }
      
          public void shutdown() {
              if (channel != null) {
                  try {
                      channel.close();
                  } finally {
                      channel = null;
                  }
              }
          }
      
          private JChannel openChannel(final String configuration) throws Exception {
              final JChannel jChannel = new JChannel(configuration); // should be OK
              return jChannel;
          }
      }
      

      Reported in community thread.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              elena.vilchik Elena Vilchik
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: