Skip to content

Commit e7e1dc5

Browse files
author
Ryan
committed
cleanup - finished fixing compiler warnings
1 parent 57e0442 commit e7e1dc5

19 files changed

+44
-20
lines changed

src/main/com/mongodb/BasicDBObjectBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public static BasicDBObjectBuilder start( String k , Object val ){
5858
* @param m map to use
5959
* @return the new builder
6060
*/
61+
@SuppressWarnings("unchecked")
6162
public static BasicDBObjectBuilder start(Map m){
6263
BasicDBObjectBuilder b = new BasicDBObjectBuilder();
6364
Iterator<Map.Entry> i = m.entrySet().iterator();

src/main/com/mongodb/Bytes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ void reset(){
148148
* @param o the object
149149
* @return the byte value associated with the type, or 0 if <code>o</code> was <code>null</code>
150150
*/
151+
@SuppressWarnings("deprecation")
151152
public static byte getType( Object o ){
152153
if ( o == null )
153154
return NULL;

src/main/com/mongodb/DBCallback.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public DBCallback( DBCollection coll ){
3333
}
3434

3535
@Override
36+
@SuppressWarnings("deprecation")
3637
public void gotDBRef( String name , String ns , ObjectId id ){
3738
if ( id.equals( Bytes.COLLECTION_REF_ID ) )
3839
cur().put( name , _collection );

src/main/com/mongodb/DBCollection.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818

1919
package com.mongodb;
2020

21-
import java.util.*;
22-
21+
// Mongo
2322
import org.bson.types.*;
24-
2523
import com.mongodb.util.*;
2624

25+
// Java
26+
import java.util.*;
27+
2728
/** This class provides a skeleton implementation of a database collection.
2829
* <p>A typical invocation sequence is thus
2930
* <blockquote><pre>
@@ -870,6 +871,7 @@ public DBObject group( GroupCommand cmd ) {
870871
* @throws MongoException
871872
* @see <a href="http://www.mongodb.org/display/DOCS/Aggregation">http://www.mongodb.org/display/DOCS/Aggregation</a>
872873
*/
874+
@Deprecated
873875
public DBObject group( DBObject args )
874876
throws MongoException {
875877
args.put( "ns" , getName() );

src/main/com/mongodb/DBPortPool.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,22 @@ private ObjectName createObjectName( ServerAddress addr ) throws MalformedObject
114114
// ----
115115

116116
public static class NoMoreConnection extends MongoInternalException {
117-
NoMoreConnection( String msg ){
118-
super( msg );
119-
}
117+
private static final long serialVersionUID = -4415279469780082174L;
118+
119+
NoMoreConnection( String msg ){
120+
super( msg );
121+
}
120122
}
121123

122124
public static class SemaphoresOut extends NoMoreConnection {
125+
private static final long serialVersionUID = -4415279469780082174L;
123126
SemaphoresOut(){
124127
super( "Out of semaphores to get db connection" );
125128
}
126129
}
127130

128131
public static class ConnectionWaitTimeOut extends NoMoreConnection {
132+
private static final long serialVersionUID = -4415279469780082174L;
129133
ConnectionWaitTimeOut(int timeout) {
130134
super("Connection wait timeout after " + timeout + " ms");
131135
}

src/main/com/mongodb/MapReduceOutput.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
public class MapReduceOutput {
1010

11+
@SuppressWarnings("unchecked")
1112
MapReduceOutput( DBCollection from , DBObject cmd, BasicDBObject raw ){
1213
_raw = raw;
1314
_cmd = cmd;

src/main/com/mongodb/OutMessage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ private void reset( int op ){
8181
void prepare(){
8282
_buffer.writeInt( 0 , _buffer.size() );
8383
}
84-
84+
85+
@SuppressWarnings("deprecation")
8586
protected boolean handleSpecialObjects( String name , BSONObject o ){
8687

8788
if ( o == null )
@@ -102,6 +103,7 @@ protected boolean handleSpecialObjects( String name , BSONObject o ){
102103
return false;
103104
}
104105

106+
@SuppressWarnings("deprecation")
105107
protected boolean putSpecial( String name , Object val ){
106108
if ( val instanceof DBPointer ){
107109
DBPointer r = (DBPointer)val;

src/main/com/mongodb/ReflectionDBObject.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public Object put( String key , Object v ){
5454
return getWrapper().set( this , key , v );
5555
}
5656

57+
@SuppressWarnings("unchecked")
5758
public void putAll( Map m ){
5859
for ( Map.Entry entry : (Set<Map.Entry>)m.entrySet() ){
5960
put( entry.getKey().toString() , entry.getValue() );

src/main/org/bson/BasicBSONObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public BasicBSONObject(String key, Object value){
5555
* Creates a DBObject from a map.
5656
* @param m map to convert
5757
*/
58+
@SuppressWarnings("unchecked")
5859
public BasicBSONObject(Map m) {
5960
super(m);
6061
}
@@ -177,6 +178,7 @@ public Object put( String key , Object val ){
177178
return super.put( key , val );
178179
}
179180

181+
@SuppressWarnings("unchecked")
180182
public void putAll( Map m ){
181183
for ( Map.Entry entry : (Set<Map.Entry>)m.entrySet() ){
182184
put( entry.getKey().toString() , entry.getValue() );

src/main/org/bson/types/BasicBSONList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public Object put( int key, Object v ) {
8282
return v;
8383
}
8484

85+
@SuppressWarnings("unchecked")
8586
public void putAll( Map m ){
8687
for ( Map.Entry entry : (Set<Map.Entry>)m.entrySet() ){
8788
put( entry.getKey().toString() , entry.getValue() );
@@ -138,6 +139,7 @@ public Set<String> keySet(){
138139
return new StringRangeSet(size());
139140
}
140141

142+
@SuppressWarnings("unchecked")
141143
public Map toMap() {
142144
Map m = new HashMap();
143145
Iterator i = this.keySet().iterator();

0 commit comments

Comments
 (0)