Skip to content

Commit 160dfa8

Browse files
remove unnecessary casts (eclipse-platform#1988)
* remove unnecessary casts
1 parent 1acae4f commit 160dfa8

File tree

34 files changed

+53
-57
lines changed

34 files changed

+53
-57
lines changed

bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-SymbolicName: org.eclipse.e4.ui.workbench.addons.swt;singleton:=true
4-
Bundle-Version: 1.5.400.qualifier
4+
Bundle-Version: 1.5.500.qualifier
55
Bundle-Name: %pluginName
66
Bundle-Vendor: %providerName
77
Bundle-Localization: plugin

bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddonUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public static MWindow getWindowFor(MUIElement element) {
347347
// null since it's not in the 'children' hierarchy
348348
while (parent != null && !(parent instanceof MWindow)) {
349349
if (parent.getTags().contains(MIN_MAXIMIZEABLE_CHILDREN_AREA_TAG) && parent instanceof MArea) {
350-
parent = ((MArea) parent).getCurSharedRef();
350+
parent = parent.getCurSharedRef();
351351
} else {
352352
parent = parent.getParent();
353353
}

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ protected void layout(Composite composite, boolean flushCache) {
163163

164164
Rectangle bounds = composite.getBounds();
165165
if (composite instanceof Shell)
166-
bounds = ((Shell) composite).getClientArea();
166+
bounds = composite.getClientArea();
167167
else {
168168
bounds.x = 0;
169169
bounds.y = 0;

bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-SymbolicName: org.eclipse.e4.ui.workbench;singleton:=true
4-
Bundle-Version: 1.15.400.qualifier
4+
Bundle-Version: 1.15.500.qualifier
55
Bundle-Name: %pluginName
66
Bundle-Vendor: %providerName
77
Bundle-Localization: plugin

bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/LocaleChangeServiceImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.eclipse.e4.core.services.translation.TranslationService;
2626
import org.eclipse.e4.ui.model.application.MApplication;
2727
import org.eclipse.e4.ui.model.application.ui.MElementContainer;
28-
import org.eclipse.e4.ui.model.application.ui.MLocalizable;
2928
import org.eclipse.e4.ui.model.application.ui.MUIElement;
3029
import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
3130
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
@@ -142,7 +141,7 @@ protected void updateLocalization(List<? extends MUIElement> children) {
142141
}
143142
}
144143

145-
((MLocalizable) element).updateLocalization();
144+
element.updateLocalization();
146145
}
147146
}
148147

bundles/org.eclipse.jface/src/org/eclipse/jface/util/ConfigureColumns.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ private boolean createColumnObjects() {
172172

173173
private Image getColumnImage(Item item) {
174174
if (item instanceof TableColumn) {
175-
return ((TableColumn) item).getImage();
175+
return item.getImage();
176176
} else if (item instanceof TreeColumn) {
177-
return ((TreeColumn) item).getImage();
177+
return item.getImage();
178178
}
179179
return null;
180180
}
@@ -301,12 +301,12 @@ private void createLabel(final Composite composite, String string) {
301301
private String getColumnName(Item item) {
302302
String result = ""; //$NON-NLS-1$
303303
if (item instanceof TableColumn) {
304-
result = ((TableColumn) item).getText();
304+
result = item.getText();
305305
if (result.trim().isEmpty()) {
306306
result = ((TableColumn) item).getToolTipText();
307307
}
308308
} else if (item instanceof TreeColumn) {
309-
result = ((TreeColumn) item).getText();
309+
result = item.getText();
310310
if (result.trim().isEmpty()) {
311311
result = ((TreeColumn) item).getToolTipText();
312312
}

bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.ltk.core.refactoring
33
Bundle-ManifestVersion: 2
44
Bundle-Name: %pluginName
55
Bundle-SymbolicName: org.eclipse.ltk.core.refactoring; singleton:=true
6-
Bundle-Version: 3.14.400.qualifier
6+
Bundle-Version: 3.14.500.qualifier
77
Bundle-Activator: org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin
88
Bundle-ActivationPolicy: lazy
99
Bundle-Vendor: %providerName

bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/ProcessorBasedRefactoring.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ private static void disableParticipant(final RefactoringParticipant participant,
430430

431431
private void addToTextChangeMap(Change change) {
432432
if (change instanceof TextChange) {
433-
Object element= ((TextChange) change).getModifiedElement();
433+
Object element= change.getModifiedElement();
434434
if (element != null) {
435435
fTextChangeMap.put(element, (TextChange) change);
436436
}

bundles/org.eclipse.search/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.search; singleton:=true
5-
Bundle-Version: 3.16.200.qualifier
5+
Bundle-Version: 3.16.300.qualifier
66
Bundle-Activator: org.eclipse.search.internal.ui.SearchPlugin
77
Bundle-ActivationPolicy: lazy
88
Bundle-Vendor: %providerName

bundles/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.eclipse.core.runtime.IPath;
3535
import org.eclipse.core.runtime.Platform;
3636

37-
import org.eclipse.core.resources.IFile;
3837
import org.eclipse.core.resources.IResource;
3938

4039
import org.eclipse.jface.dialogs.IDialogSettings;
@@ -336,7 +335,7 @@ public int computeScore(Object element) {
336335

337336
IResource resource= ((IAdaptable)element).getAdapter(IResource.class);
338337
if (resource != null && resource.getType() == IResource.FILE) {
339-
String extension= ((IFile)resource).getFileExtension();
338+
String extension= resource.getFileExtension();
340339
if (extension != null)
341340
score= Math.max(score, getScoreForFileExtension(extension));
342341
}

0 commit comments

Comments
 (0)