diff options
author | Carsten Hammer | 2020-11-01 13:37:13 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2021-08-13 08:18:08 +0000 |
commit | 3e0983faacd89a61ffb35bd78764b630497bf345 (patch) | |
tree | 85203f67d62b8b0904b5826264b7871e5cc246e9 | |
parent | c8ec4912b4f53ba9972f44b1121baf86a85bf451 (diff) | |
download | rt.equinox.p2-3e0983faacd89a61ffb35bd78764b630497bf345.tar.gz rt.equinox.p2-3e0983faacd89a61ffb35bd78764b630497bf345.tar.xz rt.equinox.p2-3e0983faacd89a61ffb35bd78764b630497bf345.zip |
Bug: new UnsupportedOperationException() not thrown inY20210820-0230Y20210819-0800Y20210819-0340Y20210818-0520Y20210817-1030Y20210817-0500Y20210813-0710S4_21_0_M3I20210818-1800I20210818-1250I20210818-0600I20210817-1840I20210817-0600I20210816-1800I20210816-0600I20210815-1800I20210815-0600I20210814-1800I20210814-0600I20210813-1800
org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportFromInstallationPage.setCheckedElements(Object[])
This code creates an exception (or error) object, but doesn't do
anything with it. For example, something like
if (x < 0) {
new IllegalArgumentException("x must be nonnegative");
}
It was probably the intent of the programmer to throw the created
exception:
if (x < 0) {
throw new IllegalArgumentException("x must be nonnegative");
}
Rank: Scariest (1), confidence: High
Pattern: RV_EXCEPTION_NOT_THROWN
Type: RV, Category: CORRECTNESS (Correctness)
Change-Id: I50c598c0d09ab05caf651d83463247278121e120
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/171584
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
3 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java index d9d68ce62..34acd48a2 100644 --- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java +++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java @@ -418,7 +418,7 @@ public class ImportFromInstallationPage extends AbstractImportPage implements IS @Override public void setCheckedElements(Object[] elements) { - new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } public ProvisioningContext getProvisioningContext() { diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java index 63084646a..d782893bd 100644 --- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java +++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java @@ -367,7 +367,7 @@ public class ImportPage extends AbstractImportPage implements ISelectableIUsPage @Override public void setCheckedElements(Object[] elements) { - new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } public ProvisioningContext getProvisioningContext() { diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationPage.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationPage.java index 8a52a05e5..7cedadb2a 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationPage.java +++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationPage.java @@ -815,7 +815,7 @@ public class MigrationPage extends WizardPage implements ISelectableIUsPage, Lis @Override public void setCheckedElements(Object[] elements) { - new UnsupportedOperationException(); + throw new UnsupportedOperationException(); } // Look for update of the current selected installation units and replace the |