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

NOP used where cast expected in Document.get(String,Class)

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.0
    • Affects Version/s: 3.0.0
    • Component/s: BSON
    • Labels:
      None

      public <T> T get(final Object key, final Class<T> clazz)

      This implementation does a 'fake' cast of (T) which discards the 'clazz' parameter altogether. value = (T) someObject is a NOP in Java, and that is why somebody has put a warnings suppression on this method.

      It's an easy fix, and I am happy to do it myself, but I don't know your project bylaws etc on user contribution and review processes. Please advise.

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

              Created:
              Updated:
              Resolved: