1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Bug 540373: Cleanup: Remove unnecessary casts

This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Remove unnecessary casts
and completing the wizard

Change-Id: I287d4066b12fc19d7f73a016e11c9405abb4ceb9
This commit is contained in:
Jonah Graham 2018-11-20 16:20:42 +00:00
parent 8985c7b63f
commit 8844a8f9f2
35 changed files with 53 additions and 53 deletions

View file

@ -336,7 +336,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
protected void configureWorkspaceSettings() { protected void configureWorkspaceSettings() {
try { try {
// create a new instance of the current class // create a new instance of the current class
IPreferencePage page = (IPreferencePage) this.getClass().newInstance(); IPreferencePage page = this.getClass().newInstance();
page.setTitle(getTitle()); page.setTitle(getTitle());
page.setImageDescriptor(image); page.setImageDescriptor(image);
// and show it // and show it

View file

@ -1029,7 +1029,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
pdomBinding = createBinding(type, method, fileLocalRec); pdomBinding = createBinding(type, method, fileLocalRec);
} else if (!getPDOM().hasLastingDefinition(pdomBinding)) { } else if (!getPDOM().hasLastingDefinition(pdomBinding)) {
pdomBinding.update(this, method); pdomBinding.update(this, method);
old.remove((ICPPMethod) pdomBinding); old.remove(pdomBinding);
// Update the tags based on the tags from the new binding. This was in // Update the tags based on the tags from the new binding. This was in
// PDOMBinding.update, but not all subclasses (e.g., PDOMCPPFunction) // PDOMBinding.update, but not all subclasses (e.g., PDOMCPPFunction)

View file

@ -85,7 +85,7 @@ class FindIASTNameDialog extends Dialog {
updateCombo(fFindField, fFindHistory); updateCombo(fFindField, fFindHistory);
if (!fFindHistory.equals(oldList) && !fFindHistory.isEmpty()) if (!fFindHistory.equals(oldList) && !fFindHistory.isEmpty())
fFindField.setText((String) fFindHistory.get(0)); fFindField.setText(fFindHistory.get(0));
else else
fFindField.setText(oldText); fFindField.setText(oldText);
if (findFieldHadFocus()) if (findFieldHadFocus())
@ -880,7 +880,7 @@ class FindIASTNameDialog extends Dialog {
} else { } else {
if (BLANK_STRING.equals(fFindField.getText())) { if (BLANK_STRING.equals(fFindField.getText())) {
if (fFindHistory.size() > 0) if (fFindHistory.size() > 0)
fFindField.setText((String) fFindHistory.get(0)); fFindField.setText(fFindHistory.get(0));
else else
fFindField.setText(BLANK_STRING); fFindField.setText(BLANK_STRING);
} }
@ -1032,7 +1032,7 @@ class FindIASTNameDialog extends Dialog {
if (editor == null) if (editor == null)
return null; return null;
return (IEditorStatusLine) editor.getAdapter(IEditorStatusLine.class); return editor.getAdapter(IEditorStatusLine.class);
} }
/** /**

View file

@ -148,7 +148,7 @@ public class ShowInDOMViewAction extends ActionDelegate implements IEditorAction
return location.toOSString(); return location.toOSString();
} }
} }
ILocationProvider locationProvider = (ILocationProvider) input.getAdapter(ILocationProvider.class); ILocationProvider locationProvider = input.getAdapter(ILocationProvider.class);
if (locationProvider != null) { if (locationProvider != null) {
IPath location = locationProvider.getPath(input); IPath location = locationProvider.getPath(input);
if (location != null) { if (location != null) {

View file

@ -105,7 +105,7 @@ public class SearchReferencesAcrossLanguagesTest extends BaseUITestCase {
assertNotNull(page); assertNotNull(page);
IEditorPart editor = IDE.openEditor(page, f_h, CUIPlugin.EDITOR_ID); IEditorPart editor = IDE.openEditor(page, f_h, CUIPlugin.EDITOR_ID);
assertNotNull(editor); assertNotNull(editor);
CEditor ceditor = (CEditor) editor.getAdapter(CEditor.class); CEditor ceditor = editor.getAdapter(CEditor.class);
assertNotNull(ceditor); assertNotNull(ceditor);
ceditor.selectAndReveal(hcontent.indexOf("m1"), 2); ceditor.selectAndReveal(hcontent.indexOf("m1"), 2);

View file

@ -131,7 +131,7 @@ public class FoldingTest extends FoldingTestBase {
} }
private void assertNoKeyCollisions() { private void assertNoKeyCollisions() {
ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor ProjectionAnnotationModel model = fEditor
.getAdapter(ProjectionAnnotationModel.class); .getAdapter(ProjectionAnnotationModel.class);
assertNotNull(model); assertNotNull(model);
int annotations = 0; int annotations = 0;

View file

@ -253,7 +253,7 @@ abstract public class FoldingTestBase extends BaseUITestCase {
protected PositionAndCollapsed[] getFoldingPositions() { protected PositionAndCollapsed[] getFoldingPositions() {
List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<PositionAndCollapsed>(); List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<PositionAndCollapsed>();
ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor ProjectionAnnotationModel model = fEditor
.getAdapter(ProjectionAnnotationModel.class); .getAdapter(ProjectionAnnotationModel.class);
assertNotNull(model); assertNotNull(model);
for (Iterator<Annotation> iter = model.getAnnotationIterator(); iter.hasNext();) { for (Iterator<Annotation> iter = model.getAnnotationIterator(); iter.hasNext();) {

View file

@ -141,7 +141,7 @@ public abstract class BaseSelectionTests extends BaseUITestCase {
final IASTName[] result = { null }; final IASTName[] result = { null };
if (sel instanceof ITextSelection) { if (sel instanceof ITextSelection) {
final ITextSelection textSel = (ITextSelection) sel; final ITextSelection textSel = (ITextSelection) sel;
ITranslationUnit tu = (ITranslationUnit) editor.getInputCElement(); ITranslationUnit tu = editor.getInputCElement();
IStatus ok = ASTProvider.getASTProvider().runOnAST(tu, ASTProvider.WAIT_IF_OPEN, monitor, IStatus ok = ASTProvider.getASTProvider().runOnAST(tu, ASTProvider.WAIT_IF_OPEN, monitor,
new ASTRunnable() { new ASTRunnable() {
@Override @Override

View file

@ -274,7 +274,7 @@ public class BuildConsoleViewer extends TextViewer
if (partitioner == null) if (partitioner == null)
return; return;
BuildConsolePartition partition = (BuildConsolePartition) partitioner.getPartition(event.lineOffset); BuildConsolePartition partition = partitioner.getPartition(event.lineOffset);
// Set background for error partitions // Set background for error partitions
if (partition != null) { if (partition != null) {
String type = partition.getType(); String type = partition.getType();

View file

@ -138,7 +138,7 @@ public class BreakpointVMProvider extends AbstractVMProvider {
if (independentCategories != null) { if (independentCategories != null) {
for (IAdaptable category : independentCategories) { for (IAdaptable category : independentCategories) {
if (!bpsLists.containsKey(category)) { if (!bpsLists.containsKey(category)) {
bpsLists.put(category, (List<IBreakpoint>) Collections.EMPTY_LIST); bpsLists.put(category, Collections.EMPTY_LIST);
} }
} }
} }

View file

@ -278,6 +278,6 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
@SuppressWarnings({ "cast", "unchecked" }) @SuppressWarnings({ "cast", "unchecked" })
@Override @Override
public List<Runnable> shutdownNow() { public List<Runnable> shutdownNow() {
return (List<Runnable>) Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }
} }

View file

@ -243,7 +243,7 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate impl
} }
String image = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null); String image = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null);
String connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) ""); String connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, "");
boolean keepContainer = configuration.getAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false); boolean keepContainer = configuration.getAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false);
boolean supportStdin = configuration.getAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT, false); boolean supportStdin = configuration.getAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT, false);
@ -356,7 +356,7 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate impl
} }
String image = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null); String image = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null);
String connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) ""); String connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, "");
boolean isLocalConnection = true; boolean isLocalConnection = true;
try { try {
Pattern ipaddrPattern = Pattern.compile("[a-z]*://([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)[:]*[0-9]*"); Pattern ipaddrPattern = Pattern.compile("[a-z]*://([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)[:]*[0-9]*");
@ -448,7 +448,7 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate impl
* @throws CoreException * @throws CoreException
*/ */
private String getProgramArguments(ILaunchConfiguration config) throws CoreException { private String getProgramArguments(ILaunchConfiguration config) throws CoreException {
String args = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) ""); String args = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
if (args != null && args.length() > 0) { if (args != null && args.length() > 0) {
args = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(args); args = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(args);
} }

View file

@ -612,7 +612,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab
tableViewer.setChecked(m, true); tableViewer.setChecked(m, true);
} }
} }
connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) ""); connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, "");
int defaultIndex = 0; int defaultIndex = 0;
connections = DockerConnectionManager.getInstance().getConnections(); connections = DockerConnectionManager.getInstance().getConnections();
if (connections.length > 0) { if (connections.length > 0) {

View file

@ -128,7 +128,7 @@ public class LaunchShortcut implements ILaunchShortcut {
IProgressMonitor sub = new SubProgressMonitor(pm, 1); IProgressMonitor sub = new SubProgressMonitor(pm, 1);
for (int i = 0; i < nElements; i++) { for (int i = 0; i < nElements; i++) {
if (elements[i] instanceof IAdaptable) { if (elements[i] instanceof IAdaptable) {
IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class); IResource r = ((IAdaptable) elements[i]).getAdapter(IResource.class);
if (r != null) { if (r != null) {
ICProject cproject = CoreModel.getDefault().create(r.getProject()); ICProject cproject = CoreModel.getDefault().create(r.getProject());
if (cproject != null) { if (cproject != null) {

View file

@ -456,7 +456,7 @@ public class GoToAddressBarWidget {
ILaunch launch = null; ILaunch launch = null;
if (context instanceof IAdaptable) { if (context instanceof IAdaptable) {
adaptable = (IAdaptable) context; adaptable = (IAdaptable) context;
launch = ((ILaunch) adaptable.getAdapter(ILaunch.class)); launch = (adaptable.getAdapter(ILaunch.class));
} }
return launch; return launch;
@ -476,7 +476,7 @@ public class GoToAddressBarWidget {
String id = UNKNOWN_CONTEXT_ID; String id = UNKNOWN_CONTEXT_ID;
if (context instanceof IAdaptable) { if (context instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) context; IAdaptable adaptable = (IAdaptable) context;
IRecurringDebugContext recurringDebugContext = (IRecurringDebugContext) adaptable IRecurringDebugContext recurringDebugContext = adaptable
.getAdapter(IRecurringDebugContext.class); .getAdapter(IRecurringDebugContext.class);
if (recurringDebugContext != null) { if (recurringDebugContext != null) {
try { try {

View file

@ -665,7 +665,7 @@ public class MemoryBrowser extends ViewPart
// Memory view support this (it was done in the call to // Memory view support this (it was done in the call to
// rendering.getLabel() above) // rendering.getLabel() above)
IMemoryBlock block = rendering.getMemoryBlock(); IMemoryBlock block = rendering.getMemoryBlock();
ILabelDecorator labelDec = (ILabelDecorator) block.getAdapter(ILabelDecorator.class); ILabelDecorator labelDec = block.getAdapter(ILabelDecorator.class);
if (labelDec != null) { if (labelDec != null) {
String newLabel = labelDec.decorateText(label, rendering); String newLabel = labelDec.decorateText(label, rendering);
if (newLabel != null) { if (newLabel != null) {
@ -1059,8 +1059,8 @@ public class MemoryBrowser extends ViewPart
if (context instanceof IAdaptable) { if (context instanceof IAdaptable) {
adaptable = (IAdaptable) context; adaptable = (IAdaptable) context;
retrieval = ((IMemoryBlockRetrieval) adaptable.getAdapter(IMemoryBlockRetrieval.class)); retrieval = (adaptable.getAdapter(IMemoryBlockRetrieval.class));
launch = ((ILaunch) adaptable.getAdapter(ILaunch.class)); launch = (adaptable.getAdapter(ILaunch.class));
} }
if (retrieval != null && launch != null && !launch.isTerminated()) { if (retrieval != null && launch != null && !launch.isTerminated()) {
@ -1113,7 +1113,7 @@ public class MemoryBrowser extends ViewPart
CTabFolder tabFolder = fContextFolders.get(retrieval); CTabFolder tabFolder = fContextFolders.get(retrieval);
if (tabFolder != null) { if (tabFolder != null) {
fStackLayout.topControl = tabFolder; fStackLayout.topControl = tabFolder;
CTabItem tabItem = (CTabItem) tabFolder.getSelection(); CTabItem tabItem = tabFolder.getSelection();
if (tabItem != null) { if (tabItem != null) {
getSite().getSelectionProvider() getSite().getSelectionProvider()
.setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING))); .setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
@ -1412,7 +1412,7 @@ public class MemoryBrowser extends ViewPart
if (retrieval instanceof IMemoryBlockRetrievalExtension) { if (retrieval instanceof IMemoryBlockRetrievalExtension) {
retrievalExtension = (IMemoryBlockRetrievalExtension) retrieval; retrievalExtension = (IMemoryBlockRetrievalExtension) retrieval;
} else if (retrieval instanceof IAdaptable) { } else if (retrieval instanceof IAdaptable) {
retrievalExtension = (IMemoryBlockRetrievalExtension) ((IAdaptable) retrieval) retrievalExtension = ((IAdaptable) retrieval)
.getAdapter(IMemoryBlockRetrievalExtension.class); .getAdapter(IMemoryBlockRetrievalExtension.class);
} }
if (retrievalExtension != null) { if (retrievalExtension != null) {

View file

@ -605,7 +605,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
protected IMemoryBlockExtension getMemoryBlock() { protected IMemoryBlockExtension getMemoryBlock() {
IMemoryBlock block = fParent.getMemoryBlock(); IMemoryBlock block = fParent.getMemoryBlock();
if (block != null) if (block != null)
return (IMemoryBlockExtension) block.getAdapter(IMemoryBlockExtension.class); return block.getAdapter(IMemoryBlockExtension.class);
return null; return null;
} }

View file

@ -225,7 +225,7 @@ public class RenderingAddressInfo extends Rendering implements IDebugContextList
if (context instanceof IAdaptable) { if (context instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) context; IAdaptable adaptable = (IAdaptable) context;
final IMemoryBlockAddressInfoRetrieval addrInfo = ((IMemoryBlockAddressInfoRetrieval) adaptable final IMemoryBlockAddressInfoRetrieval addrInfo = (adaptable
.getAdapter(IMemoryBlockAddressInfoRetrieval.class)); .getAdapter(IMemoryBlockAddressInfoRetrieval.class));
if (addrInfo == null) { if (addrInfo == null) {

View file

@ -415,7 +415,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
super.activated(); super.activated();
IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbench workbench = PlatformUI.getWorkbench();
ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class); ICommandService commandSupport = workbench.getAdapter(ICommandService.class);
if (commandSupport != null) { if (commandSupport != null) {
Command gotoCommand = commandSupport.getCommand(ID_GO_TO_ADDRESS_COMMAND); Command gotoCommand = commandSupport.getCommand(ID_GO_TO_ADDRESS_COMMAND);
@ -449,7 +449,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
@Override @Override
public void deactivated() { public void deactivated() {
IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbench workbench = PlatformUI.getWorkbench();
ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class); ICommandService commandSupport = workbench.getAdapter(ICommandService.class);
if (commandSupport != null) { if (commandSupport != null) {
// remove handler // remove handler

View file

@ -63,7 +63,7 @@ public abstract class AbstractQtPDOMClass extends QtPDOMBinding {
IBinding cppBinding = getPDOM().findBinding(cppName); IBinding cppBinding = getPDOM().findBinding(cppName);
if (cppBinding != null) { if (cppBinding != null) {
IPDOMBinding cppPDOMBinding = (IPDOMBinding) cppBinding.getAdapter(IPDOMBinding.class); IPDOMBinding cppPDOMBinding = cppBinding.getAdapter(IPDOMBinding.class);
if (cppPDOMBinding != null) { if (cppPDOMBinding != null) {
if (cppPDOMBinding.getLinkage() != null if (cppPDOMBinding.getLinkage() != null
&& cppPDOMBinding.getLinkage().getLinkageID() == ILinkage.CPP_LINKAGE_ID) && cppPDOMBinding.getLinkage().getLinkageID() == ILinkage.CPP_LINKAGE_ID)

View file

@ -21,7 +21,7 @@ import org.eclipse.core.runtime.CoreException;
public class QtPDOMASTProcessor extends IPDOMASTProcessor.Abstract { public class QtPDOMASTProcessor extends IPDOMASTProcessor.Abstract {
@Override @Override
public int process(IASTTranslationUnit ast, IIndexSymbols symbols) throws CoreException { public int process(IASTTranslationUnit ast, IIndexSymbols symbols) throws CoreException {
ast.accept(new QtASTVisitor(symbols, (LocationMap) ast.getAdapter(LocationMap.class))); ast.accept(new QtASTVisitor(symbols, ast.getAdapter(LocationMap.class)));
return ILinkage.QT_LINKAGE_ID; return ILinkage.QT_LINKAGE_ID;
} }
} }

View file

@ -126,7 +126,7 @@ public class QtPDOMLinkage extends PDOMLinkage {
return null; return null;
// If a binding has already been persisted for this instance then return it now. // If a binding has already been persisted for this instance then return it now.
QtPDOMBinding pdomBinding = (QtPDOMBinding) binding.getAdapter(QtPDOMBinding.class); QtPDOMBinding pdomBinding = binding.getAdapter(QtPDOMBinding.class);
if (pdomBinding != null && pdomBinding.getLinkage() == this) if (pdomBinding != null && pdomBinding.getLinkage() == this)
return pdomBinding; return pdomBinding;
@ -149,7 +149,7 @@ public class QtPDOMLinkage extends PDOMLinkage {
if (binding == null) if (binding == null)
return 0; return 0;
IPDOMBinding pdomBinding = (IPDOMBinding) binding.getAdapter(IPDOMBinding.class); IPDOMBinding pdomBinding = binding.getAdapter(IPDOMBinding.class);
if (pdomBinding == null) if (pdomBinding == null)
return 0; return 0;

View file

@ -133,7 +133,7 @@ public class QtPDOMQObject extends AbstractQtPDOMClass {
if (baseCls == null) if (baseCls == null)
continue; continue;
PDOMBinding pdomBinding = (PDOMBinding) baseCls.getAdapter(PDOMBinding.class); PDOMBinding pdomBinding = baseCls.getAdapter(PDOMBinding.class);
QtPDOMQObject baseQObj = ASTNameReference.findFromBinding(QtPDOMQObject.class, pdomBinding); QtPDOMQObject baseQObj = ASTNameReference.findFromBinding(QtPDOMQObject.class, pdomBinding);
if (baseQObj != null) if (baseQObj != null)
bases.add(baseQObj); bases.add(baseQObj);

View file

@ -369,7 +369,7 @@ public class QtRegressionTests extends BaseQtTestCase {
assertNotNull(page); assertNotNull(page);
IEditorPart editor = IDE.openEditor(page, file, CUIPlugin.EDITOR_ID); IEditorPart editor = IDE.openEditor(page, file, CUIPlugin.EDITOR_ID);
assertNotNull(editor); assertNotNull(editor);
CEditor ceditor = (CEditor) editor.getAdapter(CEditor.class); CEditor ceditor = editor.getAdapter(CEditor.class);
assertNotNull(ceditor); assertNotNull(ceditor);
// NOTE: This offset relies on the above comment being exactly as expected. If it is edited, // NOTE: This offset relies on the above comment being exactly as expected. If it is edited,

View file

@ -60,7 +60,7 @@ public class QObjectDeclarationCompletion {
} }
private static Position getPosition(ICEditorContentAssistInvocationContext context) { private static Position getPosition(ICEditorContentAssistInvocationContext context) {
ITextEditor textEditor = (ITextEditor) context.getEditor().getAdapter(ITextEditor.class); ITextEditor textEditor = context.getEditor().getAdapter(ITextEditor.class);
if (textEditor == null) if (textEditor == null)
return null; return null;

View file

@ -467,7 +467,7 @@ public class QPropertyAttributeProposal {
if (binding == null) if (binding == null)
return null; return null;
return (ICPPClassType) binding.getAdapter(ICPPClassType.class); return binding.getAdapter(ICPPClassType.class);
} catch (CoreException e) { } catch (CoreException e) {
Activator.log(e); Activator.log(e);
} }

View file

@ -23,7 +23,7 @@ public class QMLHyperlinkDetector extends AbstractHyperlinkDetector {
// TODO is length of region ever > 0? // TODO is length of region ever > 0?
IRegion wordRegion = QMLEditor.findWord(textViewer.getDocument(), region.getOffset()); IRegion wordRegion = QMLEditor.findWord(textViewer.getDocument(), region.getOffset());
if (wordRegion != null) { if (wordRegion != null) {
ITextEditor editor = (ITextEditor) getAdapter(ITextEditor.class); ITextEditor editor = getAdapter(ITextEditor.class);
return new IHyperlink[] { new QMLHyperlink(wordRegion, textViewer, editor) }; return new IHyperlink[] { new QMLHyperlink(wordRegion, textViewer, editor) };
} }
return null; return null;

View file

@ -151,7 +151,7 @@ public class RemoteCommandLauncher implements ICommandLauncher {
fLocalLauncher = localLauncher; fLocalLauncher = localLauncher;
} }
if (getProject() != null) { if (getProject() != null) {
IRemoteResource remRes = (IRemoteResource) getProject().getAdapter(IRemoteResource.class); IRemoteResource remRes = getProject().getAdapter(IRemoteResource.class);
if (remRes != null) { if (remRes != null) {
URI uri = remRes.getActiveLocationURI(); URI uri = remRes.getActiveLocationURI();
IRemoteServicesManager remoteServicesManager = Activator.getService(IRemoteServicesManager.class); IRemoteServicesManager remoteServicesManager = Activator.getService(IRemoteServicesManager.class);

View file

@ -113,7 +113,7 @@ public class ExtensionElement {
for (int i = 0; i < argumentsLength; ++i) { for (int i = 0; i < argumentsLength; ++i) {
argumentTypes[i] = (arguments[i] == null) ? NullType.class : arguments[i].getClass(); argumentTypes[i] = (arguments[i] == null) ? NullType.class : arguments[i].getClass();
} }
Constructor<?> constructor = (Constructor<?>) instance.getConstructor(argumentTypes); Constructor<?> constructor = instance.getConstructor(argumentTypes);
// Invoke the constructor. // Invoke the constructor.
result = (T) constructor.newInstance(arguments); result = (T) constructor.newInstance(arguments);

View file

@ -234,9 +234,9 @@ public class VirtualBoundsGraphicObject extends GraphicObject {
float ow = 0.0f; float ow = 0.0f;
float oh = 0.0f; float oh = 0.0f;
ox = (float) this.getBounds().x ox = this.getBounds().x
+ childsVirtualBounds.x * ((float) this.getBounds().width / (this.getVirtualBounds().width)); + childsVirtualBounds.x * ((float) this.getBounds().width / (this.getVirtualBounds().width));
oy = (float) this.getBounds().y oy = this.getBounds().y
+ childsVirtualBounds.y * ((float) this.getBounds().height / this.getVirtualBounds().height); + childsVirtualBounds.y * ((float) this.getBounds().height / this.getVirtualBounds().height);
ow = ((float) childsVirtualBounds.width / this.getVirtualBounds().width) * this.getBounds().width; ow = ((float) childsVirtualBounds.width / this.getVirtualBounds().width) * this.getBounds().width;
oh = ((float) childsVirtualBounds.height / this.getVirtualBounds().height) * this.getBounds().height; oh = ((float) childsVirtualBounds.height / this.getVirtualBounds().height) * this.getBounds().height;

View file

@ -110,7 +110,7 @@ abstract public class ListenerList {
} }
int count = (listeners == null) ? 0 : listeners.size(); int count = (listeners == null) ? 0 : listeners.size();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
Object listener = (Object) listeners.get(i); Object listener = listeners.get(i);
try { try {
raise(listener, event); raise(listener, event);
} catch (Throwable t) { } catch (Throwable t) {

View file

@ -113,7 +113,7 @@ public class SelectionUtils {
IStructuredSelection structuredSelection = (IStructuredSelection) selection; IStructuredSelection structuredSelection = (IStructuredSelection) selection;
result = structuredSelection.size(); result = structuredSelection.size();
} else if (selection instanceof ISelection) { } else if (selection instanceof ISelection) {
result = ((ISelection) selection).isEmpty() ? 0 : 1; result = selection.isEmpty() ? 0 : 1;
} }
// collections are not ISelections, this just makes the method a little more generic // collections are not ISelections, this just makes the method a little more generic
else if (selection instanceof Collection) { else if (selection instanceof Collection) {
@ -135,7 +135,7 @@ public class SelectionUtils {
List<Object> result = null; List<Object> result = null;
if (selection instanceof IStructuredSelection) { if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection; IStructuredSelection structuredSelection = (IStructuredSelection) selection;
result = new ArrayList<Object>((List<?>) structuredSelection.toList()); result = new ArrayList<Object>(structuredSelection.toList());
} else if (selection instanceof Collection) { } else if (selection instanceof Collection) {
Collection<?> collection = (Collection<?>) selection; Collection<?> collection = (Collection<?>) selection;
result = new ArrayList<Object>(collection); result = new ArrayList<Object>(collection);
@ -260,7 +260,7 @@ public class SelectionUtils {
result = workbench.getActiveWorkbenchWindow(); result = workbench.getActiveWorkbenchWindow();
if (result == null) { if (result == null) {
if (workbench.getWorkbenchWindowCount() > 0) { if (workbench.getWorkbenchWindowCount() > 0) {
result = (IWorkbenchWindow) workbench.getWorkbenchWindows()[0]; result = workbench.getWorkbenchWindows()[0];
} }
} }
} }

View file

@ -169,7 +169,7 @@ public class XlcCParser extends PrsStream
} }
public PrsStream getParseStream() { public PrsStream getParseStream() {
return (PrsStream) this; return this;
} }
// //
@ -200,7 +200,7 @@ public class XlcCParser extends PrsStream
public void parser(Monitor monitor, int error_repair_count) { public void parser(Monitor monitor, int error_repair_count) {
try { try {
btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this); btParser = new FixedBacktrackingParser(monitor, this, prs, this);
} catch (NotBacktrackParseTableException e) { } catch (NotBacktrackParseTableException e) {
throw new Error( throw new Error(
new NotBacktrackParseTableException("Regenerate XlcCParserprs.java with -BACKTRACK option")); new NotBacktrackParseTableException("Regenerate XlcCParserprs.java with -BACKTRACK option"));

View file

@ -171,7 +171,7 @@ public class XlcCPPParser extends PrsStream
} }
public PrsStream getParseStream() { public PrsStream getParseStream() {
return (PrsStream) this; return this;
} }
// //
@ -202,7 +202,7 @@ public class XlcCPPParser extends PrsStream
public void parser(Monitor monitor, int error_repair_count) { public void parser(Monitor monitor, int error_repair_count) {
try { try {
btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this); btParser = new FixedBacktrackingParser(monitor, this, prs, this);
} catch (NotBacktrackParseTableException e) { } catch (NotBacktrackParseTableException e) {
throw new Error( throw new Error(
new NotBacktrackParseTableException("Regenerate XlcCPPParserprs.java with -BACKTRACK option")); new NotBacktrackParseTableException("Regenerate XlcCPPParserprs.java with -BACKTRACK option"));

View file

@ -82,7 +82,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
addField(fPathEditor); addField(fPathEditor);
IProject project = ((IResource) (getElement().getAdapter(IResource.class))).getProject(); IProject project = (getElement().getAdapter(IResource.class)).getProject();
String currentPath = null; String currentPath = null;
@ -106,7 +106,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
protected void createVersionEditor() { protected void createVersionEditor() {
IProject project = ((IResource) (getElement().getAdapter(IResource.class))).getProject(); IProject project = (getElement().getAdapter(IResource.class)).getProject();
String[] versionEntries = { PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME, String[] versionEntries = { PreferenceConstants.P_XL_COMPILER_VERSION_8_NAME,
PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME,
PreferenceConstants.P_XL_COMPILER_VERSION_11_NAME }; PreferenceConstants.P_XL_COMPILER_VERSION_11_NAME };
@ -181,7 +181,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
public boolean performOk() { public boolean performOk() {
// store the value in the owner text field // store the value in the owner text field
try { try {
IProject project = ((IResource) (getElement().getAdapter(IResource.class))).getProject(); IProject project = (getElement().getAdapter(IResource.class)).getProject();
if (fPathEditor != null) { if (fPathEditor != null) {
project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$ project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$