Source:
<code>protected Control createDialogArea(final Composite parent) { Optional<Image> aboutImage = Optional.empty(); Optional<AboutItem> aboutItem = Optional.empty(); <START> if (product != null) { <END> 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; }</code><technical_language>product is null, code simplified</technical_language>

Target:
protected Control createDialogArea(final Composite parent) { Optional<Image> aboutImage = Optional.empty(); Optional<AboutItem> aboutItem = Optional.empty(); 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; }