Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mongodb/mongo-java-driver
Browse files Browse the repository at this point in the history
  • Loading branch information
jyemin committed Jan 8, 2013
2 parents 49410ef + 4247808 commit 3c917af
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ TAGS
src/test/ed/webtests/webtest-local.bash

*.ipr
*.iml
*.iws
*.iml
.idea
Expand Down
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: java

jdk:
- oraclejdk7
- openjdk6

notifications:
email:
recipients:
- jeff.yemin@10gen.com
- trisha.gee@10gen.com
on_success: change
on_failure: always

services:
- mongodb

branches:
only:
- master
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Contributing to the MongoDB Java Driver

Thank you for your interest in contributing to the MongoDB Java driver.

We are building this software together and strongly encourage contributions
from the community that are within the guidelines set forth below.

Bug Fixes and New Features
--------------------------

Before starting to write code, look for existing [tickets]
(https://jira.mongodb.org/browse/JAVA) or [create one]
(https://jira.mongodb.org/secure/CreateIssue!default.jspa)
for your bug, issue, or feature request. This helps the community
avoid working on something that might not be of interest or which
has already been addressed.

Pull Requests
-------------

Pull requests should be made against the master (development)
branch and include relevant tests, if applicable. The driver follows
the Git-Flow branching model where the traditional master branch is
known as release and the master (default) branch is considered under
development.

Code should compile and tests should pass under all Java versions
which the driver currently supports. Currently the Java driver supports
a minimum version of Java 5. Please run 'ant test' to confirm. If your
tests modify code related to replica sets, please ensure that you run the
tests with a replica set where the primary is on port 27017.

The results of pull request testing will be appended to the request.
If any tests do not pass, or relevant tests are not included the pull
request will not be considered.

Talk To Us
----------

If you want to work on something or have questions / complaints please reach
out to us by creating a Question issue at (https://jira.mongodb.org/secure/CreateIssue!default.jspa).
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@
* mailing list: http://groups.google.com/group/mongodb-user
* jira: http://jira.mongodb.org/browse/JAVA

### Build status:
[![Build Status](https://jenkins.10gen.com/job/mongo-java-driver/badge/icon)](https://jenkins.10gen.com/job/mongo-java-driver/)

### Maintainers
* Jeff Yemin jeff.yemin@10gen.com
* Antoine Girbal antoine@10gen.com
* Scott Hernandez scott@10gen.com
* Brendan McAdams brendan@10gen.com
* Trisha Gee trisha.gee@10gen.com

### Contributors:
* Scott Hernandez scott@10gen.com
* Ryan Nitz ryan@10gen.com
* Antoine Girbal antoine@10gen.com
* Brendan McAdams brendan@10gen.com
* Eliot Horowitz eliot@10gen.com
* Kristina Chodorow kristina@10gen.com
* Geir Magnusson geir@pobox.com
* Keith Branton mongoDBjira@branton.co.uk
* Dave Brosius dbrosius@mebigfatguy.com
* Scott Hernandez scotthernandez@gmail.com
* Hans Meiser hmeiser@example.com
* Benedikt Waldvogel mail@bwaldvogel.de
* William Shulman william.shulman@gmail.com
Expand All @@ -38,4 +42,3 @@
* Matthew Foemmel git@foemmel.com
* Jim Dickinson jdickinson@shopwiki.com
* Jorge Ortiz jorge.ortiz@gmail.com
* Ryan Nitz
11 changes: 2 additions & 9 deletions src/main/com/mongodb/DBApiLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@
import org.bson.BSONObject;
import org.bson.types.ObjectId;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.logging.Level;
Expand Down Expand Up @@ -406,7 +399,7 @@ public DBObject next(){
}

if ( ! _curResult.hasGetMore( _options ) )
throw new RuntimeException( "no more" );
throw new NoSuchElementException("no more");

_advance();
return next();
Expand Down
2 changes: 1 addition & 1 deletion src/main/com/mongodb/DBCursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public DBObject next() {

/**
* Returns the element the cursor is at.
* @return the next element
* @return the current element
*/
public DBObject curr(){
_checkType( CursorType.ITERATOR );
Expand Down
10 changes: 10 additions & 0 deletions src/test/com/mongodb/DBCursorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -463,6 +464,15 @@ public void testSort(){
}
}

@Test(expectedExceptions = NoSuchElementException.class)
public void testShouldThrowNoSuchElementException() {
DBCollection c = _db.getCollection("emptyCollection");

DBCursor cursor = c.find();

cursor.next();
}

@Test
public void testHasFinalizer() throws UnknownHostException {
DBCollection c = _db.getCollection( "HasFinalizerTest" );
Expand Down

0 comments on commit 3c917af

Please sign in to comment.