Skip to content

Commit cb4a95a

Browse files
laeubiCopilot
andcommitted
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>
1 parent b88b43b commit cb4a95a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ protected void initialize(IDialogSettings settings) {
189189
}
190190

191191
String selected = settings.get(S_EXPORT_METADATA);
192-
fExportMetadata.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected));
192+
fExportMetadata.setSelection(selected == null || Boolean.parseBoolean(selected));
193193

194194
// This enablement depends on both the jar button being selected and the destination setting being something other than install (bug 276989)
195195
fExportMetadata.setEnabled(fJarButton.getSelection());
@@ -207,7 +207,7 @@ protected void initialize(IDialogSettings settings) {
207207
selected = settings.get(S_CREATE_CATEGORIES);
208208

209209
fCategoryButton.setEnabled(fExportMetadata.getSelection() && fJarButton.getSelection());
210-
fCategoryButton.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected));
210+
fCategoryButton.setSelection(selected == null || Boolean.parseBoolean(selected));
211211
if (settings.get(S_CATEGORY_FILE) != null) {
212212
fCategoryCombo.setText(settings.get(S_CATEGORY_FILE));
213213
}

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ protected void initialize() {
161161
fExportSourceCombo.setEnabled(fExportSourceButton.getSelection());
162162

163163
String selected = settings.get(S_EXPORT_METADATA);
164-
fExportMetadata.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected));
164+
fExportMetadata.setSelection(selected == null || Boolean.parseBoolean(selected));
165165

166166
selected = settings.get(S_ALLOW_BINARY_CYCLES);
167-
fAllowBinaryCycles.setSelection(selected == null ? true : Boolean.TRUE.toString().equals(selected));
167+
fAllowBinaryCycles.setSelection(selected == null || Boolean.parseBoolean(selected));
168168

169169
if (fMultiPlatform != null) {
170170
fMultiPlatform.setSelection(settings.getBoolean(S_MULTI_PLATFORM));

0 commit comments

Comments
 (0)