Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4030

Suppress or fix compiler warnings about empty try blocks

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal
    • None

      Users/jeff.yemin/git/mongo-java-driver/driver-sync/src/main/com/mongodb/client/internal/Crypt.java:225: warning: [try] auto-closeable resource mongoCrypt is never referenced in body of corresponding try statement
              try (MongoCrypt mongoCrypt = this.mongoCrypt;
                              ^
      /Users/jeff.yemin/git/mongo-java-driver/driver-sync/src/main/com/mongodb/client/internal/Crypt.java:226: warning: [try] auto-closeable resource commandMarker is never referenced in body of corresponding try statement
                   CommandMarker commandMarker = this.commandMarker;
                                 ^
      /Users/jeff.yemin/git/mongo-java-driver/driver-sync/src/main/com/mongodb/client/internal/Crypt.java:227: warning: [try] auto-closeable resource internalClient is never referenced in body of corresponding try statement
                   MongoClient internalClient = this.internalClient
                               ^
      3 warnings
      
      > Task :driver-reactive-streams:compileJava
      /Users/jeff.yemin/git/mongo-java-driver/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/Crypt.java:178: warning: [try] auto-closeable resource mongoCrypt is never referenced in body of corresponding try statement
              try (MongoCrypt mongoCrypt = this.mongoCrypt;
                              ^
      /Users/jeff.yemin/git/mongo-java-driver/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/Crypt.java:179: warning: [try] auto-closeable resource commandMarker is never referenced in body of corresponding try statement
                   CommandMarker commandMarker = this.commandMarker;
                                 ^
      /Users/jeff.yemin/git/mongo-java-driver/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/Crypt.java:180: warning: [try] auto-closeable resource internalClient is never referenced in body of corresponding try statement
                   MongoClient internalClient = this.internalClient;
                               ^
      /Users/jeff.yemin/git/mongo-java-driver/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/Crypt.java:181: warning: [try] auto-closeable resource keyManagementService is never referenced in body of corresponding try statement
                   KeyManagementService keyManagementService = this.keyManagementService
                                        ^
      4 warnings
      

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: