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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.9.1
    • 2.7.3, 2.9.0
    • API
    • None
    • Any.
      (tested with 3.5.2-3.fc17.x86_64/jdk1.7.0_06(x64))
    • Major Change

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: