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

Move MongoDriverInformation class from com.mongodb.client to com.mongodb

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.0
    • Affects Version/s: None
    • Component/s: API
    • None
    • Minor Change

      The MongoDriverInformation class is part of driver-core and is in the com.mongodb.client package. This is unfortunate as it's the same package that is used for the standard driver CRUD API, e.g. com.mongodb.client.MongoCollection. And it can't just be moved into the driver module because it's also used by driver-async.

      This hasn't been a problem because prior to Java 9 it it perfectly legal to split the same package between multiple jar files. But in order to deploy the driver on the module path, even as a set of automatic modules, package splits are forbidden and will result in an error like:

      java.lang.module.ResolutionException: Module org.mongodb.driver.client contains package com.mongodb.client, module org.mongodb.driver.core exports package com.mongodb.client to org.mongodb.driver.client
      

      To rectify this situation, MongoDriverInformation must be moved to a different package, and com.mongodb seems suitable.

      While this is a breaking change, it is unlikely to affect end-user applications because this class was added only to support wrapping drivers like Reactive Streams and the Scala Driver, and those drivers can easily be updated to refer to the new location of this class. For that reason, we should consider doing this outside of a major release of the driver.

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

              Created:
              Updated:
              Resolved: