private static <T extends ConfigBeanProxy> boolean removeCustomTokens(final ConfigBeanDefaultValue configBeanDefaultValue, T finalConfigBean, ConfigBeanProxy parent) throws TransactionFailure, PropertyVetoException {
if (parent instanceof SystemPropertyBag) {
removeSystemPropertyForTokens(configBeanDefaultValue.getCustomizationTokens(), (SystemPropertyBag) parent);
return true;
} else {
ConfigBeanProxy curParent = finalConfigBean;
while (!(curParent instanceof SystemPropertyBag)) {
curParent = curParent.getParent();
}
if (configBeanDefaultValue.getCustomizationTokens().size() != 0) {
final SystemPropertyBag bag = (SystemPropertyBag) curParent;
final List<ConfigCustomizationToken> tokens = configBeanDefaultValue.getCustomizationTokens();
removeSystemPropertyForTokens(tokens, bag);