Skip to content

Commit 57e0442

Browse files
author
Ryan
committed
cleanup - fixing compiler warnings (serializable and unchecked).
1 parent 4d12e3a commit 57e0442

File tree

6 files changed

+12
-1
lines changed

6 files changed

+12
-1
lines changed

src/main/com/mongodb/QueryBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ public QueryBuilder withinBox(double x, double y, double x2, double y2) {
265265
* @param ors
266266
* @return
267267
*/
268+
@SuppressWarnings("unchecked")
268269
public QueryBuilder or( DBObject ... ors ){
269270
List l = (List)_query.get( "$or" );
270271
if ( l == null ){

src/main/com/mongodb/RawDBObject.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public Object get( String key ){
5252
return e.getObject();
5353
}
5454

55+
@SuppressWarnings("unchecked")
5556
public Map toMap() {
5657
Map m = new HashMap();
5758
Iterator i = this.keySet().iterator();

src/main/com/mongodb/ReflectionDBObject.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public boolean isPartialObject(){
8686
return false;
8787
}
8888

89+
@SuppressWarnings("unchecked")
8990
public Map toMap() {
9091
Map m = new HashMap();
9192
Iterator i = this.keySet().iterator();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public Date getUploadDate(){
135135
* note: to set aliases, call put( "aliases" , List<String> )
136136
* @return
137137
*/
138+
@SuppressWarnings("unchecked")
138139
public List<String> getAliases(){
139140
return (List<String>)_extradata.get( "aliases" );
140141
}
@@ -237,6 +238,7 @@ public boolean containsField(String s){
237238
return keySet().contains( s );
238239
}
239240

241+
@SuppressWarnings("unchecked")
240242
public Set<String> keySet(){
241243
Set<String> keys = new HashSet();
242244
keys.addAll(VALID_FIELDS);
@@ -281,6 +283,7 @@ protected void setGridFS( GridFS fs ){
281283
DBObject _extradata = new BasicDBObject();
282284
String _md5;
283285

286+
@SuppressWarnings("unchecked")
284287
final static Set<String> VALID_FIELDS = Collections.unmodifiableSet( new HashSet( Arrays.asList( new String[]{
285288
"_id" , "filename" , "contentType" , "length" , "chunkSize" ,
286289
"uploadDate" , "aliases" , "md5"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ else if ( c < 32 )
5252
}
5353
a.append("\"");
5454
}
55+
56+
@SuppressWarnings("unchecked")
5557
public static void serialize( Object o , StringBuilder buf ){
5658

5759
o = Bytes.applyEncodingHooks( o );
@@ -119,7 +121,7 @@ public static void serialize( Object o , StringBuilder buf ){
119121
buf.append( "{ " );
120122

121123
Map m = (Map)o;
122-
124+
123125
for ( Map.Entry entry : (Set<Map.Entry>)m.entrySet() ){
124126
if ( first ) first = false;
125127
else buf.append( " , " );

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
public class MyAsserts {
88

99
public static class MyAssert extends RuntimeException {
10+
11+
private static final long serialVersionUID = -4415279469780082174L;
12+
1013
MyAssert( String s ){
1114
super( s );
1215
_s = s;

0 commit comments

Comments
 (0)