You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by al...@apache.org on 2008/10/03 00:50:41 UTC
svn commit: r701266 - in /openjpa/trunk:
openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java
Author: allee8285
Date: Thu Oct 2 15:50:41 2008
New Revision: 701266
URL: http://svn.apache.org/viewvc?rev=701266&view=rev
Log:
OPENJPA-732 - Regressed a unit test. Reverting BrokerImpl back to previous level and disabling a test in the new TestMessageListener.
Modified:
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java
Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=701266&r1=701265&r2=701266&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Thu Oct 2 15:50:41 2008
@@ -1522,7 +1522,7 @@
_savepoints = new LinkedMap();
} else {
if (_savepointCache == null)
- save.save(Collections.EMPTY_SET);
+ save.save(Collections.EMPTY_LIST);
else {
save.save(_savepointCache);
_savepointCache.clear();
@@ -2190,7 +2190,7 @@
if (hasTransactionalObjects())
transStates = _transCache;
else
- transStates = Collections.EMPTY_SET;
+ transStates = Collections.EMPTY_LIST;
// fire after rollback/commit event
Collection mobjs = null;
@@ -2265,7 +2265,7 @@
// now clear trans cache; keep cleared version rather than
// null to avoid having to re-create the set later; more efficient
- if (transStates != Collections.EMPTY_SET) {
+ if (transStates != Collections.EMPTY_LIST) {
_transCache = (TransactionalCache) transStates;
_transCache.clear();
}
@@ -3310,7 +3310,7 @@
Object obj;
StateManagerImpl sm;
ClassMetaData meta;
- Collection sms = new HashSet(objs.size());
+ Collection sms = new ArrayList(objs.size());
List exceps = null;
for (Iterator itr = objs.iterator(); itr.hasNext();) {
obj = itr.next();
@@ -3637,7 +3637,7 @@
try {
assertActiveTransaction();
- Collection sms = new HashSet(objs.size());
+ Collection sms = new ArrayList(objs.size());
Object obj;
StateManagerImpl sm;
for (Iterator itr = objs.iterator(); itr.hasNext();) {
@@ -3784,7 +3784,7 @@
*/
protected Collection getTransactionalStates() {
if (!hasTransactionalObjects())
- return Collections.EMPTY_SET;
+ return Collections.EMPTY_LIST;
return _transCache.copy();
}
@@ -3803,7 +3803,7 @@
*/
protected Collection getDirtyStates() {
if (!hasTransactionalObjects())
- return Collections.EMPTY_SET;
+ return Collections.EMPTY_LIST;
return _transCache.copyDirty();
}
@@ -3814,8 +3814,8 @@
*/
protected Collection getPendingTransactionalStates() {
if (_pending == null)
- return Collections.EMPTY_SET;
- return new HashSet(_pending);
+ return Collections.EMPTY_LIST;
+ return new ArrayList(_pending);
}
/**
@@ -4036,19 +4036,19 @@
public Collection getPersistedTypes() {
if (_persistedClss == null || _persistedClss.isEmpty())
- return Collections.EMPTY_SET;
+ return Collections.EMPTY_LIST;
return Collections.unmodifiableCollection(_persistedClss);
}
public Collection getUpdatedTypes() {
if (_updatedClss == null || _updatedClss.isEmpty())
- return Collections.EMPTY_SET;
+ return Collections.EMPTY_LIST;
return Collections.unmodifiableCollection(_updatedClss);
}
public Collection getDeletedTypes() {
if (_deletedClss == null || _deletedClss.isEmpty())
- return Collections.EMPTY_SET;
+ return Collections.EMPTY_LIST;
return Collections.unmodifiableCollection(_deletedClss);
}
@@ -4503,12 +4503,12 @@
*/
public Collection copy() {
if (isEmpty())
- return Collections.EMPTY_SET;
+ return Collections.EMPTY_LIST;
// size may not be entirely accurate due to refs expiring, so
// manually copy each object; doesn't matter this way if size too
// big by some
- Set copy = new HashSet(size());
+ List copy = new ArrayList(size());
if (_dirty != null)
for (Iterator itr = _dirty.iterator(); itr.hasNext();)
copy.add(itr.next());
@@ -4523,8 +4523,8 @@
*/
public Collection copyDirty() {
if (_dirty == null || _dirty.isEmpty())
- return Collections.EMPTY_SET;
- return new HashSet(_dirty);
+ return Collections.EMPTY_LIST;
+ return new ArrayList(_dirty);
}
/**
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java?rev=701266&r1=701265&r2=701266&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/callbacks/TestMessageListeners.java Thu Oct 2 15:50:41 2008
@@ -96,6 +96,7 @@
}
public void testUpdateInPreUpdate() {
+ if( false ) {
// Create a new EntityManager from the EntityManagerFactory. The
// EntityManager is the main object in the persistence API, and is
// used to create, delete, and query objects, as well as access
@@ -165,6 +166,7 @@
if (em != null && em.isOpen())
em.close();
}
+ }
}
private void assertStatus(int prePersist, int postPersist, int preUpdate,