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

Address compiler warnings when targeting Java 8

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: Build
    • Labels:
      None

      Description

      Now that we are targeting Java 8 source and target compatibility in the 4.x branch, some new generics-related compiler warnings are appearing during compilation. Examples include

      /Users/jeff/mongo-java-driver/driver-core/src/main/com/mongodb/operation/CommandOperationHelper.java:112: warning: [overloads] <T#1>executeWrappedCommandProtocol(ReadBinding,String,BsonDocument,CommandTransformer<BsonDocument,T#1>) in CommandOperationHelper is potentially ambiguous with <T#2>executeWrappedCommandProtocol(ReadBinding,String,BsonDocument,Decoder<T#2>) in CommandOperationHelper
          static <T> T executeWrappedCommandProtocol(final ReadBinding binding, final String database, final BsonDocument command,
       
      /Users/jeff/mongo-java-driver/driver-core/src/main/com/mongodb/client/model/Filters.java:163: warning: [unchecked] Possible heap pollution from parameterized vararg type TItem
          public static <TItem> Bson in(final String fieldName, final TItem... values)
       
      
      

      The purpose of this ticket is to address or suppress these warnings so they don't distract us from new problems.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: