Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-10-11 13:02:44 -0400
committerAlexander Kurtakov2017-10-11 13:02:44 -0400
commitdf0cc1c9609a5ee3cb4a6965ee455fe51d139909 (patch)
tree69e80d5f66260c37dcbadb3b9618e5ed5078a264
parentb5eac1198dfb6644d86cfcc2e442c93899766274 (diff)
downloadrt.equinox.p2-df0cc1c9609a5ee3cb4a6965ee455fe51d139909.tar.gz
rt.equinox.p2-df0cc1c9609a5ee3cb4a6965ee455fe51d139909.tar.xz
rt.equinox.p2-df0cc1c9609a5ee3cb4a6965ee455fe51d139909.zip
Fix warnings in ui.importexport.I20171012-2000I20171011-2000
* Unnecessary else clauses. * Variables hiding. * Synthetic methods by using lambdas. Change-Id: Ibc6e456ff22313e95c2000ab26b0b439f74c6332 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/StyledErrorDialog.java18
2 files changed, 14 insertions, 19 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java
index d155c3f29..72c1fe03b 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java
@@ -97,8 +97,8 @@ public class ImportWizard extends InstallWizard implements IImportWizard {
if (planSelections.length == 0) {
operation = new InstallOperation(new ProvisioningSession(AbstractPage.agent), new ArrayList<IInstallableUnit>()) {
@Override
- protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor monitor) {
- monitor.done();
+ protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor progressMonitor) {
+ progressMonitor.done();
}
@Override
@@ -117,18 +117,17 @@ public class ImportWizard extends InstallWizard implements IImportWizard {
throw new InterruptedException();
if (operation.resolveModal(sub.newChild(200)).getSeverity() == IStatus.CANCEL)
throw new InterruptedException();
- else {
- if (withRemediation) {
- IStatus status = operation.getResolutionResult();
- if (remediationPage != null && shouldRemediate(status)) {
- computeRemediationOperation(operation, ui, monitor);
- }
+ if (withRemediation) {
+ IStatus status = operation.getResolutionResult();
+ if (remediationPage != null && shouldRemediate(status)) {
+ computeRemediationOperation(operation, ui, monitor);
}
}
Display.getDefault().asyncExec(() -> planChanged());
});
} catch (InterruptedException e) {
operation = new InstallOperation(new ProvisioningSession(AbstractPage.agent), new ArrayList<IInstallableUnit>()) {
+
@Override
public IStatus getResolutionResult() {
return Status.CANCEL_STATUS;
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/StyledErrorDialog.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/StyledErrorDialog.java
index f062a0886..4a47dc9c6 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/StyledErrorDialog.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/StyledErrorDialog.java
@@ -23,8 +23,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
@@ -140,16 +139,13 @@ public class StyledErrorDialog extends MessageDialog {
}
private void addAccessibleListeners(Label label, final Image image) {
- label.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- @Override
- public void getName(AccessibleEvent event) {
- final String accessibleMessage = getAccessibleMessageFor(image);
- if (accessibleMessage == null) {
- return;
- }
- event.result = accessibleMessage;
+ label.getAccessible().addAccessibleListener(AccessibleListener.getNameAdapter(event -> {
+ final String accessibleMessage = getAccessibleMessageFor(image);
+ if (accessibleMessage == null) {
+ return;
}
- });
+ event.result = accessibleMessage;
+ }));
}
private String getAccessibleMessageFor(Image image) {

Back to the top