Source:
<code>protected Control createDialogArea(final Composite parent) { <START> Image aboutImage = null; <END> AboutItem item = null; if (product != null) { aboutImage = product.getAboutImage(); if (aboutImage == null || aboutImage.getBounds().width <= maxImageWidth) { String aboutTextProperty = product.getAboutText(); if (aboutTextProperty != null) { aboutText = new AboutText(aboutTextProperty); item = aboutText.getAboutItem(); } } } Composite workArea = WidgetFactory.composite(SWT.NONE).layoutData(new GridData(GridData.FILL_BOTH)) .create(parent); GridLayoutFactory.fillDefaults().applyTo(workArea); Color background = JFaceColors.getBannerBackground(parent.getDisplay()); Color foreground = JFaceColors.getBannerForeground(parent.getDisplay()); Composite top = (Composite) super.createDialogArea(workArea); GridLayoutFactory.fillDefaults().applyTo(top); top.setLayoutData(new GridData(GridData.FILL_BOTH)); top.setBackground(background); top.setForeground(foreground); final Composite topContainer = WidgetFactory.composite(SWT.NONE).background(background).foreground(foreground) .create(top); GridLayoutFactory.fillDefaults().numColumns(aboutImage == null || item == null ? 1 : 2).applyTo(topContainer); int topContainerHeightHint = calculateTopContainerHeightAndCreateImage(aboutImage, background, foreground, topContainer, parent); GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, topContainerHeightHint).applyTo(topContainer); createTextWidget(parent, item, background, foreground, topContainer); return workArea; }</code><technical_language>I suggest resolve references separately, methods: Optional<Image> aboutImage Optional<AboutItem> aboutItem code complex</technical_language>

Target:
protected Control createDialogArea(final Composite parent) { Optional<Image> aboutImage = Optional.empty(); Optional<AboutItem> aboutItem = Optional.empty(); if (product != null) { aboutImage = product.getAboutImage(); if (!aboutImage.isPresent() || aboutImage.get().getBounds().width <= maxImageWidth) { String aboutTextProperty = product.getAboutText(); if (aboutTextProperty != null) { aboutText = new AboutText(aboutTextProperty); aboutItem = aboutText.getAboutItem(); } } } Composite workArea = WidgetFactory.composite(SWT.NONE).layoutData(new GridData(GridData.FILL_BOTH)) .create(parent); GridLayoutFactory.fillDefaults().applyTo(workArea); Color background = JFaceColors.getBannerBackground(parent.getDisplay()); Color foreground = JFaceColors.getBannerForeground(parent.getDisplay()); Composite top = (Composite) super.createDialogArea(workArea); GridLayoutFactory.fillDefaults().applyTo(top); top.setLayoutData(new GridData(GridData.FILL_BOTH)); top.setBackground(background); top.setForeground(foreground); final Composite topContainer = WidgetFactory.composite(SWT.NONE).background(background).foreground(foreground) .create(top); GridLayoutFactory.fillDefaults().numColumns(aboutImage == null || !aboutItem.isPresent() ? 1 : 2) .applyTo(topContainer); int topContainerHeightHint = calculateTopContainerHeightAndCreateImage(aboutImage, background, foreground, topContainer, parent); GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, topContainerHeightHint).applyTo(topContainer); aboutItem.ifPresent(c -> createTextWidget(parent, c, background, foreground, topContainer)); return workArea; }