Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2020-05-14 00:19:52 +0000
committerAlexander Kurtakov2020-05-15 08:56:13 +0000
commit1885cf19dcbcbc4ef7332320f2aadaacb9bd699d (patch)
tree276f41ebea4079f0cb1e706e08390a3eaa708105 /examples
parent0a02b26d9e63e6218f57c3699c2a225028a4a2ff (diff)
downloadeclipse.platform.swt-1885cf19dcbcbc4ef7332320f2aadaacb9bd699d.tar.gz
eclipse.platform.swt-1885cf19dcbcbc4ef7332320f2aadaacb9bd699d.tar.xz
eclipse.platform.swt-1885cf19dcbcbc4ef7332320f2aadaacb9bd699d.zip
[trivial] Remove redundant instanceof/cast
Change-Id: I4953d45d5bdcc0b628f808649727edda9270c6c9 Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
index 5500e9689a..3eeeb3b8dc 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2016 IBM Corporation and others.
+ * Copyright (c) 2006, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -23,7 +23,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.graphics.Resource;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
@@ -84,8 +83,8 @@ public class GradientDialog extends Dialog {
dialog.addListener(SWT.Close, event -> {
for (Image obj : resources) {
- if (obj != null && obj instanceof Resource) {
- ((Resource) obj).dispose();
+ if (obj != null) {
+ obj.dispose();
}
}
dialog.dispose();

Back to the top