Author: fmeschbe
Date: Fri Dec 7 11:46:45 2012
New Revision: 1418285
URL: http://svn.apache.org/viewvc?rev=1418285&view=rev
Log:
FELIX-3666 move workaround for framework bug to the isFragment bundle to apply
it where the framework bug appears
Modified:
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
Modified:
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
URL:
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java?rev=1418285&r1=1418284&r2=1418285&view=diff
==============================================================================
---
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
(original)
+++
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
Fri Dec 7 11:46:45 2012
@@ -392,9 +392,8 @@ public class BundlesServlet extends Simp
// write the state only
resp.setContentType( "application/json" ); //$NON-NLS-1$
resp.setCharacterEncoding( "UTF-8" ); //$NON-NLS-1$
- final boolean isFragment = (bundle.getState() ==
Bundle.UNINSTALLED ? false : isFragmentBundle(bundle));
- resp.getWriter().print("{\"fragment\":" + isFragment //
//$NON-NLS-1$
- + ",\"stateRaw\":" + bundle.getState() + "}");
//$NON-NLS-1$ //$NON-NLS-2$
+ resp.getWriter().print( "{\"fragment\":" + isFragmentBundle(
bundle ) // //$NON-NLS-1$
+ + ",\"stateRaw\":" + bundle.getState() + "}" );
//$NON-NLS-1$ //$NON-NLS-2$
return;
}
}
@@ -748,11 +747,19 @@ public class BundlesServlet extends Simp
}
}
- private final boolean isFragmentBundle( Bundle bundle)
+
+ private final boolean isFragmentBundle( Bundle bundle )
{
+ // Workaround for FELIX-3670
+ if ( bundle.getState() == Bundle.UNINSTALLED )
+ {
+ return bundle.getHeaders().get( Constants.FRAGMENT_HOST ) != null;
+ }
+
return getPackageAdmin().getBundleType( bundle ) ==
PackageAdmin.BUNDLE_TYPE_FRAGMENT;
}
+
private final void bundleDetails( JSONWriter jw, Bundle bundle, final
String pluginRoot, final String servicesRoot, final Locale locale)
throws JSONException
{