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 -> { <START> <END> 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(); } } }); }</code><technical_language>Previously (as method line): int criticalActionBlockerSpace = criticalSpaceActionBlockerEditor.asValueBox().getValue(); I return (twice). allow code simpler: if (criticalActionBlockerSpace == null || criticalActionBlockerSpace > storageDomainTotalSize) { criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(validationToolTipText)); } else { criticalSpaceActionBlockerEditor.markAsValid(); } able move "validationToolTipText" declaration initialization if condition (just "markAsInvalid() call" limit local variable visibility</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); Integer criticalActionBlockerSpace = criticalSpaceActionBlockerEditor.asValueBox().getValue(); if (criticalActionBlockerSpace == null || criticalActionBlockerSpace > storageDomainTotalSize) { criticalSpaceActionBlockerEditor.markAsInvalid(Arrays.asList(validationToolTipText)); } else { criticalSpaceActionBlockerEditor.markAsValid(); } }); }