Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FELIX-3666 move workaround for framework bug to the isFragment bundle…

… to apply it where the framework bug appears

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1418285 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 06dec2af8615c330c671bbca069d66ffa239b8bd 1 parent ffe081d
Felix Meschberger authored
View
15 webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
@@ -392,9 +392,8 @@ else if ( "uninstall".equals( action ) )
// 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 @@ private String toStateString( final Bundle bundle )
}
}
- 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
{
Please sign in to comment.
Something went wrong with that request. Please try again.