Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sopasakis Pantelis committed May 21, 2010
1 parent f74508e commit 82e5fbe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
15 changes: 8 additions & 7 deletions src/org/kinkydesign/decibell/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,22 +338,23 @@ private String toString(String x) {
buffer.append(":\n");
buffer.append(((Component) f.get(this)).toString(x + spaces(4)));
}
} else if (f.get(this)!=null && Collection.class.isAssignableFrom(f.get(this).getClass())) {
} else if (f.get(this) != null && Collection.class.isAssignableFrom(f.get(this).getClass())) {
Collection collection = (Collection) f.get(this);
buffer.append(spaces(3));
buffer.append("L " + f.getName() + " :\n");
for (Object o : collection) {
if (o instanceof Component) {
if (o.equals(this)) {
continue;
}
buffer.append(x);
buffer.append(spaces(3));
buffer.append("L member = \n");
buffer.append(((Component) o).toString(spaces(4)));
buffer.append(((Component) o).toString(spaces(8)));
buffer.append("\n");
} else {
buffer.append(x);
buffer.append(spaces(3));
buffer.append("L member = \n");
buffer.append(o);
buffer.append("\n");
}

}
} else {
buffer.append(x);
Expand Down
5 changes: 2 additions & 3 deletions src/org/kinkydesign/decibell/db/StatementPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public final class StatementPool {
private static final Object lock = new Object();

private DbConnector con = null;

private Map<JTable, ArrayBlockingQueue<Pair<PreparedStatement, SQLQuery>>> search =
new HashMap<JTable, ArrayBlockingQueue<Pair<PreparedStatement, SQLQuery>>>();
private Map<JTable, ArrayBlockingQueue<Pair<PreparedStatement, SQLQuery>>> searchpk =
Expand All @@ -95,7 +94,7 @@ private StatementPool(DbConnector con) {
}
for (JRelationalTable rel : ComponentRegistry.getRegistry(con).getRelationTables()) {
initRelTable(rel);
}
}
}

/**
Expand All @@ -105,7 +104,7 @@ private StatementPool(DbConnector con) {
*/
public static StatementPool getPool(DbConnector con) {
if (pools.get(con) == null) {
synchronized(lock){
synchronized (lock) {
pools.put(con, new StatementPool(con));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/org/kinkydesign/decibell/db/util/Pair.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.Map.Entry;

/**
* A simple pair implementation of the Map.Entry interface.
* A simple pair implementation of the <code>java.util.Map.Entry</code> interface.
* @author Charalampos Chomenides
* @author Pantelis Sopasakis
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package org.kinkydesign.decibell.alpha.collect;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;
import java.util.Vector;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.*;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Expand Down Expand Up @@ -70,6 +65,8 @@ public void testMasterSlave() throws ImproperRegistration {
m3.attemptRegister(db);
assertEquals(1, m3.attemptRegister(db));

System.out.println(m3);

ArrayList<Master> mastersFound = new Master().search(db);
assertNotNull(mastersFound);
assertEquals(3, mastersFound.size());
Expand Down
1 change: 1 addition & 0 deletions test/org/kinkydesign/decibell/alpha/sr/SRListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void testSRList() throws Exception {
for (SRList sr : found) {
try {
System.out.println(sr.getMyList().get(0).getMyList().get(0).getId());
System.out.println(sr);
} catch (IndexOutOfBoundsException ex) {
}
}
Expand Down

0 comments on commit 82e5fbe

Please sign in to comment.