String location = (String)b.getHeaders().get(Constants.BUNDLE_UPDATELOCATION); if(location == null || "".equals(location)) { location = b.getLocation(); }  if(uninstallBundle(b, true)) { refreshBundle(null); Bundle newBundle = Activator.getTargetBC().installBundle(location); if(Util.canBeStarted(newBundle)) { startBundle(newBundle);
if(b == Activator.getBC().getBundle()) { b.update(); } else {  String location = (String)b.getHeaders().get(Constants.BUNDLE_UPDATELOCATION); if(location == null || "".equals(location)) { location = b.getLocation(); }  if(uninstallBundle(b, true)) { refreshBundle(null); Bundle newBundle = Activator.getTargetBC().installBundle(location); if(Util.canBeStarted(newBundle)) { startBundle(newBundle); }
  void updateBundle(Bundle b) {    try {      String location = (String)b.getHeaders().get(Constants.BUNDLE_UPDATELOCATION);      if(location == null || "".equals(location)) {	location = b.getLocation();      }            if(uninstallBundle(b, true)) {	refreshBundle(null);	Bundle newBundle = Activator.getTargetBC().installBundle(location);	if(Util.canBeStarted(newBundle)) {	  startBundle(newBundle);	}      }    } catch (Exception e) {      showErr("failed to update bundle " + Util.getBundleName(b), e);    }  }