Source:
<code>protected boolean validate() { if (!super.validate()) { return false; } if (!FeatureSupported.hotUnplugMemory(getVm().getCompatibilityVersion(), getVm().getClusterArch())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_MEMORY_HOT_UNPLUG_NOT_SUPPORTED_FOR_COMPAT_VERSION_AND_ARCH, ReplacementUtils.createSetVariableString( "compatibilityVersion", getVm().getCompatibilityVersion()), ReplacementUtils.createSetVariableString( "architecture", getVm().getClusterArch())); } if (getVm().getStatus() != VMStatus.Up) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_UP); } if (getDeviceToHotUnplug() == null) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_VM_MEMORY_DEVICE_DOESNT_EXIST, ReplacementUtils.createSetVariableString( "deviceId", getParameters().getDeviceId())); } if (!VmDeviceCommonUtils.getSpecParamsIntValue(getDeviceToHotUnplug(), <START> VmDeviceCommonUtils.SPEC_PARAM_SIZE) <END> .isPresent()) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_REQUIRED_SPEC_PARAM_IS_MISSING, ReplacementUtils.createSetVariableString("deviceId", getDeviceToHotUnplug().getId()), ReplacementUtils.createSetVariableString("specParamName", VmDeviceCommonUtils.SPEC_PARAM_SIZE)); } if (!VmDeviceCommonUtils.getSpecParamsIntValue(getDeviceToHotUnplug(), VmDeviceCommonUtils.SPEC_PARAM_NODE) .isPresent()) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_REQUIRED_SPEC_PARAM_IS_MISSING, ReplacementUtils.createSetVariableString("deviceId", getDeviceToHotUnplug().getId()), ReplacementUtils.createSetVariableString("specParamName", VmDeviceCommonUtils.SPEC_PARAM_NODE)); } return true; }</code><technical_language>static imports for constants code a bit more concise</technical_language>

Target:
protected boolean validate() { if (!super.validate()) { return false; } if (!FeatureSupported.hotUnplugMemory(getVm().getCompatibilityVersion(), getVm().getClusterArch())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_MEMORY_HOT_UNPLUG_NOT_SUPPORTED_FOR_COMPAT_VERSION_AND_ARCH, ReplacementUtils.createSetVariableString( "compatibilityVersion", getVm().getCompatibilityVersion()), ReplacementUtils.createSetVariableString( "architecture", getVm().getClusterArch())); } if (getVm().getStatus() != VMStatus.Up) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_UP); } if (getDeviceToHotUnplug() == null) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_VM_MEMORY_DEVICE_DOESNT_EXIST, ReplacementUtils.createSetVariableString( "deviceId", getParameters().getDeviceId())); } if (!VmDeviceCommonUtils.getSpecParamsIntValue(getDeviceToHotUnplug(), SPEC_PARAM_SIZE) .isPresent()) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_REQUIRED_SPEC_PARAM_IS_MISSING, ReplacementUtils.createSetVariableString("deviceId", getDeviceToHotUnplug().getId()), ReplacementUtils.createSetVariableString("specParamName", SPEC_PARAM_SIZE)); } if (!VmDeviceCommonUtils.getSpecParamsIntValue(getDeviceToHotUnplug(), SPEC_PARAM_NODE) .isPresent()) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_REQUIRED_SPEC_PARAM_IS_MISSING, ReplacementUtils.createSetVariableString("deviceId", getDeviceToHotUnplug().getId()), ReplacementUtils.createSetVariableString("specParamName", SPEC_PARAM_NODE)); } return true; }