Source:
<code>public void edit(StorageModel object) { driver.edit(object); final StorageModel storageModel = object; storageModel.getAvailableStorageDomainTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { updateStorageTypesByDomainType(storageModel); }); storageModel.getAvailableStorageTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { revealStorageView(storageModel); }); storageModel.getDataCenterAlert().getEntityChangedEvent().addListener((ev, sender, args) -> { datacenterAlertIcon.setVisible(storageModel.getDataCenterAlert().getIsAvailable()); datacenterAlertIcon.setTitle(storageModel.getDataCenterAlert().getEntity()); }); warningLowSpaceIndicatorEditor.addKeyUpHandler(event -> { if (!storageModel.isNewStorage()) { storageModel.getWarningLowSpaceSize().setEntity( ConstantsManager.getInstance().getMessages().bracketsWithGB(getWarningLowSpaceSize(storageModel))); } }); criticalSpaceActionBlockerEditor.addKeyUpHandler(event -> { int criticalActionBlockerSpace = criticalSpaceActionBlockerEditor.asValueBox().getValue(); if (criticalActionBlockerSpace > <START> getStorageDomainTotalSize(storageModel)) { <END> criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(ConstantsManager .getInstance() .getMessages() .criticalSpaceActionBlockerBiggerThanStorgeDomain(getStorageDomainTotalSize(storageModel)))); } else { criticalSpaceActionBlockerEditor.markAsValid(); } }); }</code><technical_language>Suggest define (as "criticalActionBlockerSpace"): int domainMaxSize = getStorageDomainTotalSize(storageModel) replace in 2 places</technical_language>

Target:
public void edit(StorageModel object) { driver.edit(object); final StorageModel storageModel = object; storageModel.getAvailableStorageDomainTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { updateStorageTypesByDomainType(storageModel); }); storageModel.getAvailableStorageTypeItems().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { revealStorageView(storageModel); }); storageModel.getDataCenterAlert().getEntityChangedEvent().addListener((ev, sender, args) -> { datacenterAlertIcon.setVisible(storageModel.getDataCenterAlert().getIsAvailable()); datacenterAlertIcon.setTitle(storageModel.getDataCenterAlert().getEntity()); }); warningLowSpaceIndicatorEditor.addKeyUpHandler(event -> { if (!storageModel.isNewStorage()) { storageModel.getWarningLowSpaceSize().setEntity( ConstantsManager.getInstance().getMessages().bracketsWithGB(getWarningLowSpaceSize(storageModel))); } }); criticalSpaceActionBlockerEditor.addKeyUpHandler(event -> { int storageDomainTotalSize = getStorageDomainTotalSize(storageModel); String validationToolTipText = ConstantsManager .getInstance() .getMessages() .criticalSpaceActionBlockerBiggerThanStorageDomain(storageDomainTotalSize); int criticalActionBlockerSpace; if (criticalSpaceActionBlockerEditor.asValueBox().getValue() == null) { criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(validationToolTipText)); } else { criticalActionBlockerSpace = criticalSpaceActionBlockerEditor.asValueBox().getValue(); if (criticalActionBlockerSpace > storageDomainTotalSize) { criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(validationToolTipText)); } else { criticalSpaceActionBlockerEditor.markAsValid(); } } }); }