Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7907 Ant precommit task WARNINGS about unclosed resources
  3. LUCENE-9323

Fix or suppress 13 resource leak precommit warnings in lucene/replicator

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.6
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      There are 13 resource leak precommit warnings in org/apache/lucene/replicator:

       [ecj-lint] 1. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java (at line 102) [ecj-lint] 1. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java (at line 102) [ecj-lint]  ServerConnector c = new ServerConnector(server, new SslConnectionFactory(sslcontext, "http/1.1"), [ecj-lint]                  ^ [ecj-lint] Resource leak: 'c' is never closed-- [ecj-lint] 2. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/ReplicatorTestCase.java (at line 106) [ecj-lint]  ServerConnector c = new ServerConnector(server, new HttpConnectionFactory()); [ecj-lint]                  ^ [ecj-lint] Resource leak: 'c' is never closed-- [ecj-lint] 3. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 221) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 4. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 291) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 5. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 341) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 6. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 387) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 7. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 430) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 8. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 495) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 9. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 539) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 10. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 665) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 11. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 720) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 12. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestNRTReplication.java (at line 785) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed-- [ecj-lint] 13. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/TestStressNRTReplication.java (at line 1062) [ecj-lint]  LineFileDocs docs = new LineFileDocs(random()); [ecj-lint]               ^^^^ [ecj-lint] Resource leak: 'docs' is never closed 

        Attachments

        1. LUCENE-9323-01.patch
          5 kB
          Andras Salamon
        2. LUCENE-9323-01.patch
          5 kB
          Erick Erickson

          Activity

            People

            • Assignee:
              erickerickson Erick Erickson
              Reporter:
              asalamon74 Andras Salamon
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: