Skip to content

Commit 267ebdf

Browse files
committed
JAVA-573: Changed Mongo.getVersion() to return the full version string, instead of just major.minor
1 parent 7c766ca commit 267ebdf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

build.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ limitations under the License.
106106

107107
<replaceregexp file="src/main/com/mongodb/Mongo.java" match="\sMAJOR_VERSION\s=\s\d+;" replace=" MAJOR_VERSION = ${lib.major};" byline="false"/>
108108
<replaceregexp file="src/main/com/mongodb/Mongo.java" match="\sMINOR_VERSION\s=\s\d+;" replace=" MINOR_VERSION = ${lib.minor};" byline="false"/>
109+
<replaceregexp file="src/main/com/mongodb/Mongo.java" match='\sFULL_VERSION\s=\s"\S*";'
110+
replace=' FULL_VERSION = "${build.conf.lib.version}";' byline="false"/>
109111

110112
<javac
111113
srcdir="src/main"

src/main/com/mongodb/Mongo.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.concurrent.ConcurrentHashMap;
2727
import java.util.concurrent.ConcurrentMap;
2828

29+
import com.sun.tools.javac.resources.version;
2930
import org.bson.io.PoolOutputBuffer;
3031

3132
/**
@@ -88,6 +89,8 @@ public class Mongo {
8889
@Deprecated
8990
public static final int MINOR_VERSION = 8;
9091

92+
private static final String FULL_VERSION = "2.8.0.RC1";
93+
9194
static int cleanerIntervalMS;
9295
static {
9396
cleanerIntervalMS = Integer.parseInt(System.getProperty("com.mongodb.cleanerIntervalMS", "1000"));
@@ -377,10 +380,10 @@ public void dropDatabase(String dbName)
377380

378381
/**
379382
* gets this driver version
380-
* @return
383+
* @return the full version string of this driver, e.g. "2.8.0"
381384
*/
382385
public String getVersion(){
383-
return MAJOR_VERSION + "." + MINOR_VERSION;
386+
return FULL_VERSION;
384387
}
385388

386389
/**

0 commit comments

Comments
 (0)