<commit_before>package be.ugent.dao;

import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.util.JSON;
import be.ugent.MongoDBSingleton;
import be.ugent.entitity.Drug;
import be.ugent.entitity.Version;

public class VersionDao {
	private MongoDBSingleton dbSingleton = MongoDBSingleton.getInstance();
	private DB db = dbSingleton.getTestdb();

	public String getLatestVersion(){
		DBCollection coll = db.getCollection("version");
		DBCursor cursor = coll.find();
		String max = "";
		while (cursor.hasNext()) {
			DBObject o = cursor.next();
			Version version = new Version();
			version.setDescription(o.get("description")+"");
			version.setVersionID(o.get("versionID"));
			if(max.compareTo(version.getVersionID()) <= 0){
				max = version.getVersionID();
			}<commit_msg>correcte imports<commit_after>package be.ugent.dao;

import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.util.JSON;
import be.ugent.MongoDBSingleton;
import be.ugent.entitity.Drug;
import be.ugent.entitity.Version;

public class VersionDao {
	private MongoDBSingleton dbSingleton = MongoDBSingleton.getInstance();
	private DB db = dbSingleton.getTestdb();

	public String getLatestVersion(){
		DBCollection coll = db.getCollection("version");
		DBCursor cursor = coll.find();
		String max = "";
		while (cursor.hasNext()) {
			DBObject o = cursor.next();
			Version version = new Version();
			version.setDescription(o.get("description")+"");
			version.setVersionID(""+o.get("versionID"));
			if(max.compareTo(version.getVersionID()) <= 0){
				max = version.getVersionID();
			}
{'fraction_non_alphanumeric': 0.13425925925925927, 'fraction_numerical': 0.00102880658436214, 'mean_word_length': 5.274193548387097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2125490', 'n_tokens_mistral': 686, 'n_tokens_neox': 640, 'n_words': 127}