We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following unit test:
import java.util.List;
import org.apache.jdbm.DB; import org.apache.jdbm.DBMaker; import org.junit.Test;
public class JDBMTester {
@Test public void testAddValueToHead() { DB db = DBMaker.openFile("tmp2").make(); List<String> list = getList(db, "list2"); list.add(0, "1"); db.commit(); db.close(); db = DBMaker.openFile("tmp2").make(); list = getList(db, "list2"); list.add(0, "0"); db.commit(); db.close(); } private <K> List<K> getList(DB db, String name) { List<K> result = db.getLinkedList(name); if (result == null) { result = db.createLinkedList(name); } return result; }
}
The text was updated successfully, but these errors were encountered:
When adding to the front of the list, need to update the Root's pointer to first. Need to change LinkedList2.java:
421: Root r = getRoot(); 422: r.size++; 423: db.update(rootRecid, r, ROOT_SERIALIZER);
421: Root r = getRoot(); ADD: if (prev == 0) r.first = recid; 422: r.size++; 423: db.update(rootRecid, r, ROOT_SERIALIZER);
Sorry, something went wrong.
No branches or pull requests
Consider the following unit test:
import java.util.List;
import org.apache.jdbm.DB;
import org.apache.jdbm.DBMaker;
import org.junit.Test;
public class JDBMTester {
}
The text was updated successfully, but these errors were encountered: