You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/07/19 12:02:41 UTC
svn commit: r423419 -
/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
Author: rickhall
Date: Wed Jul 19 03:02:38 2006
New Revision: 423419
URL: http://svn.apache.org/viewvc?rev=423419&view=rev
Log:
Modified BundleCache.remove() to check for a null parameter.
Modified:
incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java?rev=423419&r1=423418&r2=423419&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java Wed Jul 19 03:02:38 2006
@@ -170,21 +170,24 @@
public synchronized void remove(BundleArchive ba)
throws Exception
{
- // Remove the archive.
- ba.dispose();
- // Remove the archive from the cache.
- int idx = getArchiveIndex(ba);
- if (idx >= 0)
+ if (ba != null)
{
- BundleArchive[] tmp =
- new BundleArchive[m_archives.length - 1];
- System.arraycopy(m_archives, 0, tmp, 0, idx);
- if (idx < tmp.length)
+ // Remove the archive.
+ ba.dispose();
+ // Remove the archive from the cache.
+ int idx = getArchiveIndex(ba);
+ if (idx >= 0)
{
- System.arraycopy(m_archives, idx + 1, tmp, idx,
- tmp.length - idx);
+ BundleArchive[] tmp =
+ new BundleArchive[m_archives.length - 1];
+ System.arraycopy(m_archives, 0, tmp, 0, idx);
+ if (idx < tmp.length)
+ {
+ System.arraycopy(m_archives, idx + 1, tmp, idx,
+ tmp.length - idx);
+ }
+ m_archives = tmp;
}
- m_archives = tmp;
}
}