Source:
<code>private void unmanage(final Location loc, ManagementTransitionMode mode, boolean hasBeenReplaced) { if (shouldSkipUnmanagement(loc)) return; if (hasBeenReplaced) { if (mode==ManagementTransitionMode.REBINDING_NO_LONGER_PRIMARY) { managementContext.getRebindManager().getChangeListener().onUnmanaged(loc); if (managementContext.gc != null) managementContext.gc.onUnmanaged(loc); } else { if (!mode.wasReadOnly()) <START> log.warn("Should not be unmanaging "+loc+" in mode "+mode); <END> } } else if (mode==ManagementTransitionMode.REBINDING_DESTROYED) { unmanageNonRecursive(loc); managementContext.getRebindManager().getChangeListener().onUnmanaged(loc); if (managementContext.gc != null) managementContext.gc.onUnmanaged(loc); } else if (mode==ManagementTransitionMode.DESTROYING) { recursively(loc, new Predicate<AbstractLocation>() { public boolean apply(AbstractLocation it) { if (shouldSkipUnmanagement(it)) return false; boolean result = unmanageNonRecursive(it); if (result) { ManagementTransitionMode mode = getLastManagementTransitionMode(it.getId()); if (mode==null) { log.warn("Missing transition mode for "+it+" when unmanaging; assuming primary"); mode = ManagementTransitionMode.DESTROYING; } if (!mode.isReadOnly()) it.onManagementStopped(); managementContext.getRebindManager().getChangeListener().onUnmanaged(it); if (!mode.isReadOnly()) recordLocationEvent(it, Lifecycle.DESTROYED); if (managementContext.gc != null) managementContext.gc.onUnmanaged(it); } return result; } }); } else { log.warn("Invalid mode for unmanage: "+mode+" on "+loc+" (ignoring)"); } }</code><technical_language>Is this a programming error? throw exception? is a similar case above</technical_language>

Target:
private void unmanage(final Location loc, ManagementTransitionMode mode, boolean hasBeenReplaced) { if (shouldSkipUnmanagement(loc)) return; if (hasBeenReplaced) { if (mode==ManagementTransitionMode.REBINDING_NO_LONGER_PRIMARY) { managementContext.getRebindManager().getChangeListener().onUnmanaged(loc); if (managementContext.gc != null) managementContext.gc.onUnmanaged(loc); } else { if (!mode.wasReadOnly()) log.warn("Should not be unmanaging "+loc+" in mode "+mode+"; ignoring"); } } else if (mode==ManagementTransitionMode.REBINDING_DESTROYED) { unmanageNonRecursive(loc); managementContext.getRebindManager().getChangeListener().onUnmanaged(loc); if (managementContext.gc != null) managementContext.gc.onUnmanaged(loc); } else if (mode==ManagementTransitionMode.DESTROYING) { recursively(loc, new Predicate<AbstractLocation>() { public boolean apply(AbstractLocation it) { if (shouldSkipUnmanagement(it)) return false; boolean result = unmanageNonRecursive(it); if (result) { ManagementTransitionMode mode = getLastManagementTransitionMode(it.getId()); if (mode==null) { log.warn("Missing transition mode for "+it+" when unmanaging; assuming primary"); mode = ManagementTransitionMode.DESTROYING; } if (!mode.isReadOnly()) it.onManagementStopped(); managementContext.getRebindManager().getChangeListener().onUnmanaged(it); if (!mode.isReadOnly()) recordLocationEvent(it, Lifecycle.DESTROYED); if (managementContext.gc != null) managementContext.gc.onUnmanaged(it); } return result; } }); } else { log.warn("Invalid mode for unmanage: "+mode+" on "+loc+" (ignoring)"); } }