Source:
public DataCommandResult remove(String key, String keyClass, String regionName, String removeAllKeys, InternalCache cache) { if (StringUtils.isEmpty(regionName)) { return DataCommandResult.createRemoveResult(key, null, null, CliStrings.REMOVE__MSG__REGIONNAME_EMPTY, false); } if (StringUtils.isEmpty(removeAllKeys) && (key == null)) { return DataCommandResult.createRemoveResult(null, null, null, "BR" + CliStrings.REMOVE__MSG__KEY_EMPTY, false); } Region region = cache.getRegion(regionName); if (region == null) { return DataCommandResult.createRemoveInfoResult(key, null, null, CliStrings.format(CliStrings.REMOVE__MSG__REGION_NOT_FOUND, regionName), false); } else { if (removeAllKeys == null) { Object keyObject; try { keyObject = getClassObject(key, keyClass); } catch (ClassNotFoundException e) { return DataCommandResult.createRemoveResult(key, null, null, "ClassNotFoundException " + keyClass, false); } catch (IllegalArgumentException e) { return DataCommandResult.createRemoveResult(key, null, null, "Error in converting JSON " + e.getMessage(), false); } if (region.containsKey(keyObject)) { Object value = region.remove(keyObject); if (logger.isDebugEnabled()) { logger.debug("Removed key successfully", key); } Object[] array = getClassAndJson(value); DataCommandResult result = DataCommandResult.createRemoveResult(key, array[1], null, null, true); if (array[0] != null) { result.setValueClass((String) array[0]); } return result; } else { return DataCommandResult.createRemoveInfoResult(key, null, null, CliStrings.REMOVE__MSG__KEY_NOT_FOUND_REGION, false); } } else { return clear(region, regionName); } } }

Target:
public DataCommandResult remove(String key, String keyClass, String regionName, String removeAllKeys, InternalCache cache) { if (StringUtils.isEmpty(regionName)) { return DataCommandResult.createRemoveResult(key, null, null, CliStrings.REMOVE__MSG__REGIONNAME_EMPTY, false); } if (StringUtils.isEmpty(removeAllKeys) && (key == null)) { return DataCommandResult.createRemoveResult(null, null, null, CliStrings.REMOVE__MSG__KEY_EMPTY, false); } Region region = cache.getRegion(regionName); if (region == null) { return DataCommandResult.createRemoveInfoResult(key, null, null, CliStrings.format(CliStrings.REMOVE__MSG__REGION_NOT_FOUND, regionName), false); } else { if (removeAllKeys == null) { Object keyObject; try { keyObject = getClassObject(key, keyClass); } catch (ClassNotFoundException e) { return DataCommandResult.createRemoveResult(key, null, null, "ClassNotFoundException " + keyClass, false); } catch (IllegalArgumentException e) { return DataCommandResult.createRemoveResult(key, null, null, "Error in converting JSON " + e.getMessage(), false); } if (region.containsKey(keyObject)) { Object value = region.remove(keyObject); if (logger.isDebugEnabled()) { logger.debug("Removed key successfully", key); } Object[] array = getClassAndJson(value); DataCommandResult result = DataCommandResult.createRemoveResult(key, array[1], null, null, true); if (array[0] != null) { result.setValueClass((String) array[0]); } return result; } else { return DataCommandResult.createRemoveInfoResult(key, null, null, CliStrings.REMOVE__MSG__KEY_NOT_FOUND_REGION, false); } } else { return clear(region, regionName); } } }