User: salborini
Date: 00/11/02 11:16:28
Modified: src/main/org/jboss/ejb/plugins EnterpriseInstanceCache.java
Log:
Removed "paranoid checks"
Revision Changes Path
1.4 +4 -13
jboss/src/main/org/jboss/ejb/plugins/EnterpriseInstanceCache.java
Index: EnterpriseInstanceCache.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EnterpriseInstanceCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EnterpriseInstanceCache.java 2000/10/19 21:47:26 1.3
+++ EnterpriseInstanceCache.java 2000/11/02 19:16:27 1.4
@@ -35,7 +35,7 @@
* </ul>
*
* @author Simone Bordet ([EMAIL PROTECTED])
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public abstract class EnterpriseInstanceCache
implements InstanceCache, XmlLoadable
@@ -106,15 +106,11 @@
Object key = getKey(ctx);
synchronized (getCacheLock())
{
- // Paranoid check...
- if (getCache().peek(key) == null)
+ if (getCache().peek(key) != null)
{
- getCache().insert(key, ctx);
+ getCache().remove(key);
}
- else
- {
- throw new IllegalStateException("Can't insert bean
with id = " + key + ": it is already in the cache.");
- }
+ getCache().insert(key, ctx);
}
}
/* From InstanceCache interface */
@@ -132,14 +128,9 @@
synchronized (getCacheLock())
{
- // Paranoid check...
if (getCache().peek(id) != null)
{
getCache().remove(id);
- }
- else
- {
- throw new IllegalStateException("Can't remove bean
with id = " + id + ": it isn't in the cache.");
}
}
removeLock(id);