Source:
protected boolean canDoAction() { boolean returnValue = super.canDoAction() && checkStoragePool(); _oldStoragePool = getStoragePoolDAO().get(getStoragePool().getId()); if (returnValue && !StringUtils.equals(_oldStoragePool.getname(), getStoragePool().getname()) && getStoragePoolDAO().getByName(getStoragePool().getname()) != null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NAME_ALREADY_EXIST); } if (returnValue && _oldStoragePool.getstorage_pool_type() != getStoragePool() .getstorage_pool_type() && getStorageDomainStaticDAO().getAllForStoragePool(getStoragePool().getId()).size() > 0) { returnValue = false; getReturnValue() .getCanDoActionMessages() .add(VdcBllMessages.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_DOMAINS .toString()); } returnValue = returnValue && CheckStoragePoolNameLengthValid(); if (returnValue && Version.OpInequality(_oldStoragePool.getcompatibility_version(), getStoragePool() .getcompatibility_version())) { if (!isStoragePoolVersionSupported()) { addCanDoActionMessage(VersionSupport.getUnsupportedVersionMessage()); returnValue = false; } else if (getStoragePool().getcompatibility_version().compareTo(_oldStoragePool.getcompatibility_version()) < 0) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION); } else { returnValue = checkAllClustersLevel(); } } StoragePoolValidator validator = createStoragePoolValidator(); if (returnValue) { returnValue = validator.isNotLocalfsWithDefaultCluster(); } if (returnValue) { returnValue = validator.isPosixDcAndMatchingCompatiblityVersion(); } if (!returnValue) { returnValue = validator.isGlusterDcAndMatchingCompatiblityVersion(); } addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE); return returnValue; }

Target:
protected boolean canDoAction() { boolean returnValue = super.canDoAction() && checkStoragePool(); _oldStoragePool = getStoragePoolDAO().get(getStoragePool().getId()); if (returnValue && !StringUtils.equals(_oldStoragePool.getname(), getStoragePool().getname()) && getStoragePoolDAO().getByName(getStoragePool().getname()) != null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NAME_ALREADY_EXIST); } if (returnValue && _oldStoragePool.getstorage_pool_type() != getStoragePool() .getstorage_pool_type() && getStorageDomainStaticDAO().getAllForStoragePool(getStoragePool().getId()).size() > 0) { returnValue = false; getReturnValue() .getCanDoActionMessages() .add(VdcBllMessages.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_DOMAINS .toString()); } returnValue = returnValue && CheckStoragePoolNameLengthValid(); if (returnValue && Version.OpInequality(_oldStoragePool.getcompatibility_version(), getStoragePool() .getcompatibility_version())) { if (!isStoragePoolVersionSupported()) { addCanDoActionMessage(VersionSupport.getUnsupportedVersionMessage()); returnValue = false; } else if (getStoragePool().getcompatibility_version().compareTo(_oldStoragePool.getcompatibility_version()) < 0) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION); } else { returnValue = checkAllClustersLevel(); } } StoragePoolValidator validator = createStoragePoolValidator(); if (returnValue) { returnValue = validator.isNotLocalfsWithDefaultCluster(); } if (returnValue) { returnValue = validator.isPosixDcAndMatchingCompatiblityVersion(); } if (returnValue) { returnValue = validator.isGlusterDcAndMatchingCompatiblityVersion(); } addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE); return returnValue; }