Skip to content

Commit 0322ed0

Browse files
author
Ryan
committed
misc code cleanup - chipping away at the compiler warnings.
1 parent f33612a commit 0322ed0

16 files changed

+52
-7
lines changed

src/main/com/mongodb/BasicDBList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*/
2828
public class BasicDBList extends BasicBSONList implements DBObject {
2929

30+
private static final long serialVersionUID = -4415279469780082174L;
31+
3032
/**
3133
* Returns a JSON serialization of this object
3234
* @return JSON serialization

src/main/com/mongodb/BasicDBObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* </pre></blockquote>
3434
*/
3535
public class BasicDBObject extends BasicBSONObject implements DBObject {
36+
37+
private static final long serialVersionUID = -4415279469780082174L;
3638

3739
/**
3840
* Creates an empty object.

src/main/com/mongodb/DBCallback.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public void objectStart(boolean array, String name){
5050
public Object objectDone(){
5151
BSONObject o = (BSONObject)super.objectDone();
5252
if ( ! ( o instanceof List ) &&
53-
o.containsKey( "$ref" ) &&
54-
o.containsKey( "$id" ) ){
53+
o.containsField( "$ref" ) &&
54+
o.containsField( "$id" ) ){
5555
return cur().put( _lastName , new DBRef( _db, o ) );
5656
}
5757

src/main/com/mongodb/DBPointer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/**
2424
* @deprecated
2525
*/
26+
@Deprecated
2627
public class DBPointer extends DBRefBase {
2728

2829
static final boolean D = Boolean.getBoolean( "DEBUG.DBPOINTER" );

src/main/com/mongodb/MongoException.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
*/
2727
public class MongoException extends RuntimeException {
2828

29+
private static final long serialVersionUID = -4415279469780082174L;
30+
2931
/**
3032
* @param msg the message
3133
*/
@@ -92,6 +94,8 @@ static Throwable _massage( Throwable t ){
9294
*/
9395
public static class Network extends MongoException {
9496

97+
private static final long serialVersionUID = -4415279469780082174L;
98+
9599
Network( String msg , java.io.IOException ioe ){
96100
super( -2 , msg , ioe );
97101
_ioe = ioe;
@@ -109,6 +113,9 @@ public static class Network extends MongoException {
109113
* Subclass of MongoException representing a duplicate key exception
110114
*/
111115
public static class DuplicateKey extends MongoException {
116+
117+
private static final long serialVersionUID = -4415279469780082174L;
118+
112119
DuplicateKey( int code , String msg ){
113120
super( code , msg );
114121
}
@@ -118,6 +125,9 @@ public static class DuplicateKey extends MongoException {
118125
* Subclass of MongoException representing a cursor-not-found exception
119126
*/
120127
public static class CursorNotFound extends MongoException {
128+
129+
private static final long serialVersionUID = -4415279469780082174L;
130+
121131
CursorNotFound(){
122132
super( -5 , "cursor not found on server" );
123133
}

src/main/com/mongodb/MongoInternalException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525
public class MongoInternalException extends MongoException {
2626

27+
private static final long serialVersionUID = -4415279469780082174L;
28+
2729
/**
2830
*
2931
* @param msg the message
@@ -42,3 +44,4 @@ public MongoInternalException( String msg , Throwable t ){
4244
}
4345

4446
}
47+

src/main/com/mongodb/RawDBObject.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public Object removeField( String key ){
7878
throw new RuntimeException( "read only" );
7979
}
8080

81+
/**
82+
* @deprecated
83+
*/
84+
@Deprecated
8185
public boolean containsKey( String key ){
8286
return containsField(key);
8387
}

src/main/com/mongodb/ReflectionDBObject.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public Set<String> keySet(){
3838
return getWrapper().keySet();
3939
}
4040

41+
/**
42+
* @deprecated
43+
*/
44+
@Deprecated
4145
public boolean containsKey( String s ){
4246
return containsField( s );
4347
}
@@ -162,6 +166,10 @@ public Set<String> keySet(){
162166
return _keys;
163167
}
164168

169+
/**
170+
* @deprecated
171+
*/
172+
@Deprecated
165173
public boolean containsKey( String key ){
166174
return _keys.contains( key );
167175
}

src/main/com/mongodb/gridfs/GridFSFile.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ public Object removeField( String key ){
217217
throw new UnsupportedOperationException();
218218
}
219219

220+
/*
221+
* @deprecated
222+
*/
223+
@Deprecated
220224
public boolean containsKey( String s ){
221225
return containsField( s );
222226
}

src/main/com/mongodb/util/JSON.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ else if(current == ']') {
673673
*/
674674
class JSONParseException extends RuntimeException {
675675

676+
private static final long serialVersionUID = -4415279469780082174L;
677+
676678
String s;
677679
int pos;
678680

0 commit comments

Comments
 (0)