From e217206883109cadcf849b6d0d42cf8ee0ddc660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Mon, 23 Mar 2026 10:43:07 +0100 Subject: [PATCH] Replace Boolean.TRUE.toString().equals() with Boolean.parseBoolean() Replace the verbose Boolean.TRUE.toString().equals(selected) pattern with the simpler Boolean.parseBoolean(selected) in FeatureOptionsTab and ProductExportWizardPage. Also simplify the ternary expressions: selected == null ? true : Boolean.TRUE.toString().equals(selected) becomes: selected == null || Boolean.parseBoolean(selected) This is consistent with adjacent ExportOptionsTab which already uses Boolean.parseBoolean() for the same purpose. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../pde/internal/ui/wizards/exports/FeatureOptionsTab.java | 4 ++-- .../internal/ui/wizards/exports/ProductExportWizardPage.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java index aaf9dabd93d..e6eab3a5514 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java @@ -189,7 +189,7 @@ protected void initialize(IDialogSettings settings) { } String selected = settings.get(S_EXPORT_METADATA); - fExportMetadata.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected)); + fExportMetadata.setSelection(selected == null || Boolean.parseBoolean(selected)); // This enablement depends on both the jar button being selected and the destination setting being something other than install (bug 276989) fExportMetadata.setEnabled(fJarButton.getSelection()); @@ -207,7 +207,7 @@ protected void initialize(IDialogSettings settings) { selected = settings.get(S_CREATE_CATEGORIES); fCategoryButton.setEnabled(fExportMetadata.getSelection() && fJarButton.getSelection()); - fCategoryButton.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected)); + fCategoryButton.setSelection(selected == null || Boolean.parseBoolean(selected)); if (settings.get(S_CATEGORY_FILE) != null) { fCategoryCombo.setText(settings.get(S_CATEGORY_FILE)); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java index 7288b7dd363..96103f5d176 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java @@ -161,10 +161,10 @@ protected void initialize() { fExportSourceCombo.setEnabled(fExportSourceButton.getSelection()); String selected = settings.get(S_EXPORT_METADATA); - fExportMetadata.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected)); + fExportMetadata.setSelection(selected == null || Boolean.parseBoolean(selected)); selected = settings.get(S_ALLOW_BINARY_CYCLES); - fAllowBinaryCycles.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected)); + fAllowBinaryCycles.setSelection(selected == null || Boolean.parseBoolean(selected)); if (fMultiPlatform != null) { fMultiPlatform.setSelection(settings.getBoolean(S_MULTI_PLATFORM));