diff --git a/src/main/com/mongodb/DBApiLayer.java b/src/main/com/mongodb/DBApiLayer.java index a2cd37a0937..16b6b3914a0 100644 --- a/src/main/com/mongodb/DBApiLayer.java +++ b/src/main/com/mongodb/DBApiLayer.java @@ -21,10 +21,10 @@ import java.util.*; import java.util.logging.*; -import com.mongodb.util.*; - import org.bson.*; import org.bson.types.*; + +import com.mongodb.util.*; /** Database API * This cannot be directly instantiated, but the functions are available * through instances of Mongo. @@ -250,7 +250,8 @@ void killCursors( List all ) _connector.say( _db , om , WriteConcern.NONE ); } - public Iterator find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options ) + @Override + Iterator find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options ) throws MongoException { if ( ref == null ) diff --git a/src/main/com/mongodb/DBCollection.java b/src/main/com/mongodb/DBCollection.java index eb59270c859..710a2c5b9b2 100644 --- a/src/main/com/mongodb/DBCollection.java +++ b/src/main/com/mongodb/DBCollection.java @@ -18,11 +18,10 @@ package com.mongodb; -import org.bson.*; -import org.bson.types.*; - import java.util.*; +import org.bson.types.*; + /** This class provides a skeleton implementation of a database collection. *

A typical invocation sequence is thus *

@@ -32,6 +31,7 @@
  * 
* @dochub collections */ +@SuppressWarnings("unchecked") public abstract class DBCollection { final static boolean DEBUG = Boolean.getBoolean( "DEBUG.DB" ); @@ -106,7 +106,7 @@ public void updateMulti( DBObject q , DBObject o ) throws MongoException { * @return the objects, if found * @dochub find */ - public abstract Iterator find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options ) throws MongoException ; + abstract Iterator find( DBObject ref , DBObject fields , int numToSkip , int batchSize , int options ) throws MongoException ; /** Finds an object. * @param ref query used to search @@ -116,7 +116,7 @@ public void updateMulti( DBObject q , DBObject o ) throws MongoException { * @return the objects, if found * @dochub find */ - public Iterator find( DBObject ref , DBObject fields , int numToSkip , int batchSize ) + Iterator find( DBObject ref , DBObject fields , int numToSkip , int batchSize ) throws MongoException { return find( ref , fields , numToSkip , batchSize , 0 ); } @@ -547,7 +547,7 @@ public List distinct( String key ){ * find distinct values for a key * @param query query to apply on collection */ - public List distinct( String key , DBObject query ){ + public List distinct( String key , DBObject query ){ DBObject c = BasicDBObjectBuilder.start() .add( "distinct" , getName() ) .add( "key" , key ) @@ -812,7 +812,4 @@ public DB.WriteConcern getWriteConcern(){ final private Set _createIndexes = new HashSet(); final private Set _createIndexesAfterSave = new HashSet(); - - private final static DBObject _upsertOptions = BasicDBObjectBuilder.start().add( "upsert" , true ).get(); - }