mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +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:
parent
8985c7b63f
commit
8844a8f9f2
35 changed files with 53 additions and 53 deletions
|
@ -336,7 +336,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
|
|||
protected void configureWorkspaceSettings() {
|
||||
try {
|
||||
// create a new instance of the current class
|
||||
IPreferencePage page = (IPreferencePage) this.getClass().newInstance();
|
||||
IPreferencePage page = this.getClass().newInstance();
|
||||
page.setTitle(getTitle());
|
||||
page.setImageDescriptor(image);
|
||||
// and show it
|
||||
|
|
|
@ -1029,7 +1029,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
pdomBinding = createBinding(type, method, fileLocalRec);
|
||||
} else if (!getPDOM().hasLastingDefinition(pdomBinding)) {
|
||||
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
|
||||
// PDOMBinding.update, but not all subclasses (e.g., PDOMCPPFunction)
|
||||
|
|
|
@ -85,7 +85,7 @@ class FindIASTNameDialog extends Dialog {
|
|||
|
||||
updateCombo(fFindField, fFindHistory);
|
||||
if (!fFindHistory.equals(oldList) && !fFindHistory.isEmpty())
|
||||
fFindField.setText((String) fFindHistory.get(0));
|
||||
fFindField.setText(fFindHistory.get(0));
|
||||
else
|
||||
fFindField.setText(oldText);
|
||||
if (findFieldHadFocus())
|
||||
|
@ -880,7 +880,7 @@ class FindIASTNameDialog extends Dialog {
|
|||
} else {
|
||||
if (BLANK_STRING.equals(fFindField.getText())) {
|
||||
if (fFindHistory.size() > 0)
|
||||
fFindField.setText((String) fFindHistory.get(0));
|
||||
fFindField.setText(fFindHistory.get(0));
|
||||
else
|
||||
fFindField.setText(BLANK_STRING);
|
||||
}
|
||||
|
@ -1032,7 +1032,7 @@ class FindIASTNameDialog extends Dialog {
|
|||
if (editor == null)
|
||||
return null;
|
||||
|
||||
return (IEditorStatusLine) editor.getAdapter(IEditorStatusLine.class);
|
||||
return editor.getAdapter(IEditorStatusLine.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -148,7 +148,7 @@ public class ShowInDOMViewAction extends ActionDelegate implements IEditorAction
|
|||
return location.toOSString();
|
||||
}
|
||||
}
|
||||
ILocationProvider locationProvider = (ILocationProvider) input.getAdapter(ILocationProvider.class);
|
||||
ILocationProvider locationProvider = input.getAdapter(ILocationProvider.class);
|
||||
if (locationProvider != null) {
|
||||
IPath location = locationProvider.getPath(input);
|
||||
if (location != null) {
|
||||
|
|
|
@ -105,7 +105,7 @@ public class SearchReferencesAcrossLanguagesTest extends BaseUITestCase {
|
|||
assertNotNull(page);
|
||||
IEditorPart editor = IDE.openEditor(page, f_h, CUIPlugin.EDITOR_ID);
|
||||
assertNotNull(editor);
|
||||
CEditor ceditor = (CEditor) editor.getAdapter(CEditor.class);
|
||||
CEditor ceditor = editor.getAdapter(CEditor.class);
|
||||
assertNotNull(ceditor);
|
||||
|
||||
ceditor.selectAndReveal(hcontent.indexOf("m1"), 2);
|
||||
|
|
|
@ -131,7 +131,7 @@ public class FoldingTest extends FoldingTestBase {
|
|||
}
|
||||
|
||||
private void assertNoKeyCollisions() {
|
||||
ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor
|
||||
ProjectionAnnotationModel model = fEditor
|
||||
.getAdapter(ProjectionAnnotationModel.class);
|
||||
assertNotNull(model);
|
||||
int annotations = 0;
|
||||
|
|
|
@ -253,7 +253,7 @@ abstract public class FoldingTestBase extends BaseUITestCase {
|
|||
|
||||
protected PositionAndCollapsed[] getFoldingPositions() {
|
||||
List<PositionAndCollapsed> positionAndCollapseds = new ArrayList<PositionAndCollapsed>();
|
||||
ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor
|
||||
ProjectionAnnotationModel model = fEditor
|
||||
.getAdapter(ProjectionAnnotationModel.class);
|
||||
assertNotNull(model);
|
||||
for (Iterator<Annotation> iter = model.getAnnotationIterator(); iter.hasNext();) {
|
||||
|
|
|
@ -141,7 +141,7 @@ public abstract class BaseSelectionTests extends BaseUITestCase {
|
|||
final IASTName[] result = { null };
|
||||
if (sel instanceof ITextSelection) {
|
||||
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,
|
||||
new ASTRunnable() {
|
||||
@Override
|
||||
|
|
|
@ -274,7 +274,7 @@ public class BuildConsoleViewer extends TextViewer
|
|||
if (partitioner == null)
|
||||
return;
|
||||
|
||||
BuildConsolePartition partition = (BuildConsolePartition) partitioner.getPartition(event.lineOffset);
|
||||
BuildConsolePartition partition = partitioner.getPartition(event.lineOffset);
|
||||
// Set background for error partitions
|
||||
if (partition != null) {
|
||||
String type = partition.getType();
|
||||
|
|
|
@ -138,7 +138,7 @@ public class BreakpointVMProvider extends AbstractVMProvider {
|
|||
if (independentCategories != null) {
|
||||
for (IAdaptable category : independentCategories) {
|
||||
if (!bpsLists.containsKey(category)) {
|
||||
bpsLists.put(category, (List<IBreakpoint>) Collections.EMPTY_LIST);
|
||||
bpsLists.put(category, Collections.EMPTY_LIST);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,6 +278,6 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
|
|||
@SuppressWarnings({ "cast", "unchecked" })
|
||||
@Override
|
||||
public List<Runnable> shutdownNow() {
|
||||
return (List<Runnable>) Collections.EMPTY_LIST;
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate impl
|
|||
}
|
||||
|
||||
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 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 connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
|
||||
String connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, "");
|
||||
boolean isLocalConnection = true;
|
||||
try {
|
||||
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
|
||||
*/
|
||||
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) {
|
||||
args = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(args);
|
||||
}
|
||||
|
|
|
@ -612,7 +612,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab
|
|||
tableViewer.setChecked(m, true);
|
||||
}
|
||||
}
|
||||
connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
|
||||
connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, "");
|
||||
int defaultIndex = 0;
|
||||
connections = DockerConnectionManager.getInstance().getConnections();
|
||||
if (connections.length > 0) {
|
||||
|
|
|
@ -128,7 +128,7 @@ public class LaunchShortcut implements ILaunchShortcut {
|
|||
IProgressMonitor sub = new SubProgressMonitor(pm, 1);
|
||||
for (int i = 0; i < nElements; i++) {
|
||||
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) {
|
||||
ICProject cproject = CoreModel.getDefault().create(r.getProject());
|
||||
if (cproject != null) {
|
||||
|
|
|
@ -456,7 +456,7 @@ public class GoToAddressBarWidget {
|
|||
ILaunch launch = null;
|
||||
if (context instanceof IAdaptable) {
|
||||
adaptable = (IAdaptable) context;
|
||||
launch = ((ILaunch) adaptable.getAdapter(ILaunch.class));
|
||||
launch = (adaptable.getAdapter(ILaunch.class));
|
||||
}
|
||||
|
||||
return launch;
|
||||
|
@ -476,7 +476,7 @@ public class GoToAddressBarWidget {
|
|||
String id = UNKNOWN_CONTEXT_ID;
|
||||
if (context instanceof IAdaptable) {
|
||||
IAdaptable adaptable = (IAdaptable) context;
|
||||
IRecurringDebugContext recurringDebugContext = (IRecurringDebugContext) adaptable
|
||||
IRecurringDebugContext recurringDebugContext = adaptable
|
||||
.getAdapter(IRecurringDebugContext.class);
|
||||
if (recurringDebugContext != null) {
|
||||
try {
|
||||
|
|
|
@ -665,7 +665,7 @@ public class MemoryBrowser extends ViewPart
|
|||
// Memory view support this (it was done in the call to
|
||||
// rendering.getLabel() above)
|
||||
IMemoryBlock block = rendering.getMemoryBlock();
|
||||
ILabelDecorator labelDec = (ILabelDecorator) block.getAdapter(ILabelDecorator.class);
|
||||
ILabelDecorator labelDec = block.getAdapter(ILabelDecorator.class);
|
||||
if (labelDec != null) {
|
||||
String newLabel = labelDec.decorateText(label, rendering);
|
||||
if (newLabel != null) {
|
||||
|
@ -1059,8 +1059,8 @@ public class MemoryBrowser extends ViewPart
|
|||
|
||||
if (context instanceof IAdaptable) {
|
||||
adaptable = (IAdaptable) context;
|
||||
retrieval = ((IMemoryBlockRetrieval) adaptable.getAdapter(IMemoryBlockRetrieval.class));
|
||||
launch = ((ILaunch) adaptable.getAdapter(ILaunch.class));
|
||||
retrieval = (adaptable.getAdapter(IMemoryBlockRetrieval.class));
|
||||
launch = (adaptable.getAdapter(ILaunch.class));
|
||||
}
|
||||
|
||||
if (retrieval != null && launch != null && !launch.isTerminated()) {
|
||||
|
@ -1113,7 +1113,7 @@ public class MemoryBrowser extends ViewPart
|
|||
CTabFolder tabFolder = fContextFolders.get(retrieval);
|
||||
if (tabFolder != null) {
|
||||
fStackLayout.topControl = tabFolder;
|
||||
CTabItem tabItem = (CTabItem) tabFolder.getSelection();
|
||||
CTabItem tabItem = tabFolder.getSelection();
|
||||
if (tabItem != null) {
|
||||
getSite().getSelectionProvider()
|
||||
.setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
|
||||
|
@ -1412,7 +1412,7 @@ public class MemoryBrowser extends ViewPart
|
|||
if (retrieval instanceof IMemoryBlockRetrievalExtension) {
|
||||
retrievalExtension = (IMemoryBlockRetrievalExtension) retrieval;
|
||||
} else if (retrieval instanceof IAdaptable) {
|
||||
retrievalExtension = (IMemoryBlockRetrievalExtension) ((IAdaptable) retrieval)
|
||||
retrievalExtension = ((IAdaptable) retrieval)
|
||||
.getAdapter(IMemoryBlockRetrievalExtension.class);
|
||||
}
|
||||
if (retrievalExtension != null) {
|
||||
|
|
|
@ -605,7 +605,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
|
|||
protected IMemoryBlockExtension getMemoryBlock() {
|
||||
IMemoryBlock block = fParent.getMemoryBlock();
|
||||
if (block != null)
|
||||
return (IMemoryBlockExtension) block.getAdapter(IMemoryBlockExtension.class);
|
||||
return block.getAdapter(IMemoryBlockExtension.class);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ public class RenderingAddressInfo extends Rendering implements IDebugContextList
|
|||
if (context instanceof IAdaptable) {
|
||||
IAdaptable adaptable = (IAdaptable) context;
|
||||
|
||||
final IMemoryBlockAddressInfoRetrieval addrInfo = ((IMemoryBlockAddressInfoRetrieval) adaptable
|
||||
final IMemoryBlockAddressInfoRetrieval addrInfo = (adaptable
|
||||
.getAdapter(IMemoryBlockAddressInfoRetrieval.class));
|
||||
|
||||
if (addrInfo == null) {
|
||||
|
|
|
@ -415,7 +415,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
super.activated();
|
||||
|
||||
IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
|
||||
ICommandService commandSupport = workbench.getAdapter(ICommandService.class);
|
||||
|
||||
if (commandSupport != null) {
|
||||
Command gotoCommand = commandSupport.getCommand(ID_GO_TO_ADDRESS_COMMAND);
|
||||
|
@ -449,7 +449,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
@Override
|
||||
public void deactivated() {
|
||||
IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
|
||||
ICommandService commandSupport = workbench.getAdapter(ICommandService.class);
|
||||
|
||||
if (commandSupport != null) {
|
||||
// remove handler
|
||||
|
|
|
@ -63,7 +63,7 @@ public abstract class AbstractQtPDOMClass extends QtPDOMBinding {
|
|||
|
||||
IBinding cppBinding = getPDOM().findBinding(cppName);
|
||||
if (cppBinding != null) {
|
||||
IPDOMBinding cppPDOMBinding = (IPDOMBinding) cppBinding.getAdapter(IPDOMBinding.class);
|
||||
IPDOMBinding cppPDOMBinding = cppBinding.getAdapter(IPDOMBinding.class);
|
||||
if (cppPDOMBinding != null) {
|
||||
if (cppPDOMBinding.getLinkage() != null
|
||||
&& cppPDOMBinding.getLinkage().getLinkageID() == ILinkage.CPP_LINKAGE_ID)
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
public class QtPDOMASTProcessor extends IPDOMASTProcessor.Abstract {
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ public class QtPDOMLinkage extends PDOMLinkage {
|
|||
return null;
|
||||
|
||||
// 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)
|
||||
return pdomBinding;
|
||||
|
||||
|
@ -149,7 +149,7 @@ public class QtPDOMLinkage extends PDOMLinkage {
|
|||
if (binding == null)
|
||||
return 0;
|
||||
|
||||
IPDOMBinding pdomBinding = (IPDOMBinding) binding.getAdapter(IPDOMBinding.class);
|
||||
IPDOMBinding pdomBinding = binding.getAdapter(IPDOMBinding.class);
|
||||
if (pdomBinding == null)
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ public class QtPDOMQObject extends AbstractQtPDOMClass {
|
|||
if (baseCls == null)
|
||||
continue;
|
||||
|
||||
PDOMBinding pdomBinding = (PDOMBinding) baseCls.getAdapter(PDOMBinding.class);
|
||||
PDOMBinding pdomBinding = baseCls.getAdapter(PDOMBinding.class);
|
||||
QtPDOMQObject baseQObj = ASTNameReference.findFromBinding(QtPDOMQObject.class, pdomBinding);
|
||||
if (baseQObj != null)
|
||||
bases.add(baseQObj);
|
||||
|
|
|
@ -369,7 +369,7 @@ public class QtRegressionTests extends BaseQtTestCase {
|
|||
assertNotNull(page);
|
||||
IEditorPart editor = IDE.openEditor(page, file, CUIPlugin.EDITOR_ID);
|
||||
assertNotNull(editor);
|
||||
CEditor ceditor = (CEditor) editor.getAdapter(CEditor.class);
|
||||
CEditor ceditor = editor.getAdapter(CEditor.class);
|
||||
assertNotNull(ceditor);
|
||||
|
||||
// NOTE: This offset relies on the above comment being exactly as expected. If it is edited,
|
||||
|
|
|
@ -60,7 +60,7 @@ public class QObjectDeclarationCompletion {
|
|||
}
|
||||
|
||||
private static Position getPosition(ICEditorContentAssistInvocationContext context) {
|
||||
ITextEditor textEditor = (ITextEditor) context.getEditor().getAdapter(ITextEditor.class);
|
||||
ITextEditor textEditor = context.getEditor().getAdapter(ITextEditor.class);
|
||||
if (textEditor == null)
|
||||
return null;
|
||||
|
||||
|
|
|
@ -467,7 +467,7 @@ public class QPropertyAttributeProposal {
|
|||
if (binding == null)
|
||||
return null;
|
||||
|
||||
return (ICPPClassType) binding.getAdapter(ICPPClassType.class);
|
||||
return binding.getAdapter(ICPPClassType.class);
|
||||
} catch (CoreException e) {
|
||||
Activator.log(e);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class QMLHyperlinkDetector extends AbstractHyperlinkDetector {
|
|||
// TODO is length of region ever > 0?
|
||||
IRegion wordRegion = QMLEditor.findWord(textViewer.getDocument(), region.getOffset());
|
||||
if (wordRegion != null) {
|
||||
ITextEditor editor = (ITextEditor) getAdapter(ITextEditor.class);
|
||||
ITextEditor editor = getAdapter(ITextEditor.class);
|
||||
return new IHyperlink[] { new QMLHyperlink(wordRegion, textViewer, editor) };
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -151,7 +151,7 @@ public class RemoteCommandLauncher implements ICommandLauncher {
|
|||
fLocalLauncher = localLauncher;
|
||||
}
|
||||
if (getProject() != null) {
|
||||
IRemoteResource remRes = (IRemoteResource) getProject().getAdapter(IRemoteResource.class);
|
||||
IRemoteResource remRes = getProject().getAdapter(IRemoteResource.class);
|
||||
if (remRes != null) {
|
||||
URI uri = remRes.getActiveLocationURI();
|
||||
IRemoteServicesManager remoteServicesManager = Activator.getService(IRemoteServicesManager.class);
|
||||
|
|
|
@ -113,7 +113,7 @@ public class ExtensionElement {
|
|||
for (int i = 0; i < argumentsLength; ++i) {
|
||||
argumentTypes[i] = (arguments[i] == null) ? NullType.class : arguments[i].getClass();
|
||||
}
|
||||
Constructor<?> constructor = (Constructor<?>) instance.getConstructor(argumentTypes);
|
||||
Constructor<?> constructor = instance.getConstructor(argumentTypes);
|
||||
|
||||
// Invoke the constructor.
|
||||
result = (T) constructor.newInstance(arguments);
|
||||
|
|
|
@ -234,9 +234,9 @@ public class VirtualBoundsGraphicObject extends GraphicObject {
|
|||
float ow = 0.0f;
|
||||
float oh = 0.0f;
|
||||
|
||||
ox = (float) this.getBounds().x
|
||||
ox = this.getBounds().x
|
||||
+ 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);
|
||||
ow = ((float) childsVirtualBounds.width / this.getVirtualBounds().width) * this.getBounds().width;
|
||||
oh = ((float) childsVirtualBounds.height / this.getVirtualBounds().height) * this.getBounds().height;
|
||||
|
|
|
@ -110,7 +110,7 @@ abstract public class ListenerList {
|
|||
}
|
||||
int count = (listeners == null) ? 0 : listeners.size();
|
||||
for (int i = 0; i < count; i++) {
|
||||
Object listener = (Object) listeners.get(i);
|
||||
Object listener = listeners.get(i);
|
||||
try {
|
||||
raise(listener, event);
|
||||
} catch (Throwable t) {
|
||||
|
|
|
@ -113,7 +113,7 @@ public class SelectionUtils {
|
|||
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
|
||||
result = structuredSelection.size();
|
||||
} 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
|
||||
else if (selection instanceof Collection) {
|
||||
|
@ -135,7 +135,7 @@ public class SelectionUtils {
|
|||
List<Object> result = null;
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
|
||||
result = new ArrayList<Object>((List<?>) structuredSelection.toList());
|
||||
result = new ArrayList<Object>(structuredSelection.toList());
|
||||
} else if (selection instanceof Collection) {
|
||||
Collection<?> collection = (Collection<?>) selection;
|
||||
result = new ArrayList<Object>(collection);
|
||||
|
@ -260,7 +260,7 @@ public class SelectionUtils {
|
|||
result = workbench.getActiveWorkbenchWindow();
|
||||
if (result == null) {
|
||||
if (workbench.getWorkbenchWindowCount() > 0) {
|
||||
result = (IWorkbenchWindow) workbench.getWorkbenchWindows()[0];
|
||||
result = workbench.getWorkbenchWindows()[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ public class XlcCParser extends PrsStream
|
|||
}
|
||||
|
||||
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) {
|
||||
try {
|
||||
btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this);
|
||||
btParser = new FixedBacktrackingParser(monitor, this, prs, this);
|
||||
} catch (NotBacktrackParseTableException e) {
|
||||
throw new Error(
|
||||
new NotBacktrackParseTableException("Regenerate XlcCParserprs.java with -BACKTRACK option"));
|
||||
|
|
|
@ -171,7 +171,7 @@ public class XlcCPPParser extends PrsStream
|
|||
}
|
||||
|
||||
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) {
|
||||
try {
|
||||
btParser = new FixedBacktrackingParser(monitor, (TokenStream) this, prs, (RuleAction) this);
|
||||
btParser = new FixedBacktrackingParser(monitor, this, prs, this);
|
||||
} catch (NotBacktrackParseTableException e) {
|
||||
throw new Error(
|
||||
new NotBacktrackParseTableException("Regenerate XlcCPPParserprs.java with -BACKTRACK option"));
|
||||
|
|
|
@ -82,7 +82,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
|
|||
|
||||
addField(fPathEditor);
|
||||
|
||||
IProject project = ((IResource) (getElement().getAdapter(IResource.class))).getProject();
|
||||
IProject project = (getElement().getAdapter(IResource.class)).getProject();
|
||||
|
||||
String currentPath = null;
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
|
|||
|
||||
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,
|
||||
PreferenceConstants.P_XL_COMPILER_VERSION_9_NAME, PreferenceConstants.P_XL_COMPILER_VERSION_10_NAME,
|
||||
PreferenceConstants.P_XL_COMPILER_VERSION_11_NAME };
|
||||
|
@ -181,7 +181,7 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements
|
|||
public boolean performOk() {
|
||||
// store the value in the owner text field
|
||||
try {
|
||||
IProject project = ((IResource) (getElement().getAdapter(IResource.class))).getProject();
|
||||
IProject project = (getElement().getAdapter(IResource.class)).getProject();
|
||||
|
||||
if (fPathEditor != null) {
|
||||
project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue