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

DBCollection.isCapped() method throws ClassCastException with mongodb-2.2.0

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.9.1
    • Affects Version/s: 2.7.3, 2.9.0
    • Component/s: API
    • Labels:
      None
    • Environment:
      Any.
      (tested with 3.5.2-3.fc17.x86_64/jdk1.7.0_06(x64))
    • Major Change

      Apparently mongodb 2.2.0 changed the type of "capped" property returned by getStats() method for collections from integer to boolean.
      As a result an attempt to invoke DBCollection.isCapped() on capped collection when working with mongodb version 2.2.0 leads to ClassCastException.

      I have attached the test that demonstrates the problem. The test will happily run with mongodb versions 2.0.x and below but fail with 2.2.0.
      The source also provides an alternative implementation of isCapped() that fixes the problem.

            Assignee:
            bryan.reinero Bryan Reinero
            Reporter:
            akrainiouk Alexei Krainiouk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: