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 2009/06/12 17:28:37 UTC
svn commit: r784160 -
/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
Author: rickhall
Date: Fri Jun 12 15:28:37 2009
New Revision: 784160
URL: http://svn.apache.org/viewvc?rev=784160&view=rev
Log:
Applied patch (FELIX-1203) to check for uninstalled bundle.
Modified:
felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java?rev=784160&r1=784159&r2=784160&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java (original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java Fri Jun 12 15:28:37 2009
@@ -714,6 +714,11 @@
// old can't be null because of the way we calculate deleted list.
Bundle bundle = context.getBundle(old.getBundleId());
+ if ( bundle == null )
+ {
+ log( "Failed to uninstall bundle: " + jar.getPath() + " with id: "+old.getBundleId() + ". The bundle has already been uninstalled", null );
+ return null;
+ }
bundle.uninstall();
startupFailures.remove(bundle);
log("Uninstalled " + jar.getPath(), null);
@@ -734,6 +739,14 @@
File file = new File(jar.getPath());
in = new FileInputStream(file);
Bundle bundle = context.getBundle(jar.getBundleId());
+ if (bundle == null)
+ {
+ log("Failed to update bundle: "
+ + jar.getPath() + " with ID "
+ + jar.getBundleId()
+ + ". The bundle has been uninstalled", null);
+ return null;
+ }
bundle.update(in);
startupFailures.remove(bundle);
jar.setLastModified(bundle.getLastModified());