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

Remove unnecessary @SuppressWarnings

Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Marc Khouzam 2015-03-25 11:38:18 -04:00
parent ef53a9fa4d
commit a04d64606e
27 changed files with 29 additions and 33 deletions

View file

@ -75,7 +75,7 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
List<Annotation> exact= new ArrayList<Annotation>(); List<Annotation> exact= new ArrayList<Annotation>();
List<Annotation> including= new ArrayList<Annotation>(); List<Annotation> including= new ArrayList<Annotation>();
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= model.getAnnotationIterator(); Iterator e= model.getAnnotationIterator();
while (e.hasNext()) { while (e.hasNext()) {
Object o= e.next(); Object o= e.next();

View file

@ -19,7 +19,7 @@ import org.eclipse.ui.editors.text.TextFileDocumentProvider;
public class AutoconfDocumentProvider extends TextFileDocumentProvider { public class AutoconfDocumentProvider extends TextFileDocumentProvider {
public void shutdown() { public void shutdown() {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= getConnectedElementsIterator(); Iterator e= getConnectedElementsIterator();
while (e.hasNext()) while (e.hasNext())
disconnect(e.next()); disconnect(e.next());

View file

@ -185,7 +185,7 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
} }
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings({ "rawtypes" })
public Object getAdapter(Class required) { public Object getAdapter(Class required) {
if (ProjectionAnnotationModel.class.equals(required)) { if (ProjectionAnnotationModel.class.equals(required)) {
if (fProjectionSupport != null) { if (fProjectionSupport != null) {

View file

@ -86,7 +86,7 @@ public class AutoconfErrorHandler implements IAutoconfErrorHandler {
public void removeExistingMarkers(int offset, int length) public void removeExistingMarkers(int offset, int length)
{ {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator i = fAnnotationModel.getAnnotationIterator(); Iterator i = fAnnotationModel.getAnnotationIterator();
while (i.hasNext()) { while (i.hasNext()) {
Annotation annotation = (Annotation)i.next(); Annotation annotation = (Annotation)i.next();

View file

@ -45,7 +45,7 @@ public class AutoconfContentOutlinePage extends ContentOutlinePage {
protected ISelection updateSelection(ISelection sel) { protected ISelection updateSelection(ISelection sel) {
ArrayList<AutoconfElement> newSelection= new ArrayList<AutoconfElement>(); ArrayList<AutoconfElement> newSelection= new ArrayList<AutoconfElement>();
if (sel instanceof IStructuredSelection) { if (sel instanceof IStructuredSelection) {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator iter= ((IStructuredSelection)sel).iterator(); Iterator iter= ((IStructuredSelection)sel).iterator();
for (;iter.hasNext();) { for (;iter.hasNext();) {
//ICElement elem= fInput.findEqualMember((ICElement)iter.next()); //ICElement elem= fInput.findEqualMember((ICElement)iter.next());

View file

@ -49,7 +49,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
int yoursStart= offset; int yoursStart= offset;
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= presentation.getAllStyleRangeIterator(); Iterator e= presentation.getAllStyleRangeIterator();
while (e.hasNext()) { while (e.hasNext()) {

View file

@ -404,7 +404,7 @@ public class ProjectionFileUpdater implements IProjectionListener {
private Map<AutoconfElement, List<AutoconfProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) { private Map<AutoconfElement, List<AutoconfProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
Map<AutoconfElement, List<AutoconfProjectionAnnotation>> map= new HashMap<AutoconfElement, List<AutoconfProjectionAnnotation>>(); Map<AutoconfElement, List<AutoconfProjectionAnnotation>> map= new HashMap<AutoconfElement, List<AutoconfProjectionAnnotation>>();
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= model.getAnnotationIterator(); Iterator e= model.getAnnotationIterator();
while (e.hasNext()) { while (e.hasNext()) {
Object annotation= e.next(); Object annotation= e.next();

View file

@ -97,7 +97,7 @@ public class AutomakeDocumentProvider extends TextFileDocumentProvider implement
* @see org.eclipse.cdt.internal.autotools.ui.editors.automake.IMakefileDocumentProvider#shutdown() * @see org.eclipse.cdt.internal.autotools.ui.editors.automake.IMakefileDocumentProvider#shutdown()
*/ */
public void shutdown() { public void shutdown() {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= getConnectedElementsIterator(); Iterator e= getConnectedElementsIterator();
while (e.hasNext()) while (e.hasNext())
disconnect(e.next()); disconnect(e.next());

View file

@ -103,7 +103,7 @@ public class AutomakeEditor extends MakefileEditor {
/* (non-Javadoc) /* (non-Javadoc)
* Method declared on IAdaptable * Method declared on IAdaptable
*/ */
public Object getAdapter(@SuppressWarnings("unchecked") Class key) { public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
if (key.equals(IContentOutlinePage.class)) { if (key.equals(IContentOutlinePage.class)) {
return getAutomakeOutlinePage(); return getAutomakeOutlinePage();
} }

View file

@ -92,7 +92,7 @@ public class MakefileAnnotationHover implements IAnnotationHover, IAnnotationHov
List<Annotation> exact= new ArrayList<Annotation>(); List<Annotation> exact= new ArrayList<Annotation>();
List<Annotation> including= new ArrayList<Annotation>(); List<Annotation> including= new ArrayList<Annotation>();
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= model.getAnnotationIterator(); Iterator e= model.getAnnotationIterator();
while (e.hasNext()) { while (e.hasNext()) {
Object o= e.next(); Object o= e.next();

View file

@ -137,7 +137,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
* @see org.eclipse.cdt.internal.autotools.ui.editors.automake.MakefileDocumentProvider#shutdown() * @see org.eclipse.cdt.internal.autotools.ui.editors.automake.MakefileDocumentProvider#shutdown()
*/ */
public void shutdown() { public void shutdown() {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= getConnectedElementsIterator(); Iterator e= getConnectedElementsIterator();
while (e.hasNext()) while (e.hasNext())
disconnect(e.next()); disconnect(e.next());

View file

@ -166,7 +166,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc) /* (non-Javadoc)
* Method declared on IAdaptable * Method declared on IAdaptable
*/ */
public Object getAdapter(@SuppressWarnings("unchecked") Class key) { public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
if (ProjectionAnnotationModel.class.equals(key)) { if (ProjectionAnnotationModel.class.equals(key)) {
if (projectionSupport != null) { if (projectionSupport != null) {
Object result = projectionSupport.getAdapter(getSourceViewer(), key); Object result = projectionSupport.getAdapter(getSourceViewer(), key);

View file

@ -277,7 +277,7 @@ public class OpenIncludeAction extends Action {
private static IInclude getIncludeStatement(ISelection sel) { private static IInclude getIncludeStatement(ISelection sel) {
if (!sel.isEmpty() && sel instanceof IStructuredSelection) { if (!sel.isEmpty() && sel instanceof IStructuredSelection) {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
List list= ((IStructuredSelection)sel).toList(); List list= ((IStructuredSelection)sel).toList();
if (list.size() == 1) { if (list.size() == 1) {
Object element= list.get(0); Object element= list.get(0);

View file

@ -151,7 +151,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
if (fInput != null) { if (fInput != null) {
ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class); ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model != null) { if (model != null) {
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Map additions= computeAdditions((IParent) fInput); Map additions= computeAdditions((IParent) fInput);
model.removeAllAnnotations(); model.removeAllAnnotations();
model.replaceAnnotations(null, additions); model.replaceAnnotations(null, additions);
@ -371,7 +371,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
private Map<IDirective, List<MakefileProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) { private Map<IDirective, List<MakefileProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
Map<IDirective, List<MakefileProjectionAnnotation>> map= new HashMap<IDirective, List<MakefileProjectionAnnotation>>(); Map<IDirective, List<MakefileProjectionAnnotation>> map= new HashMap<IDirective, List<MakefileProjectionAnnotation>>();
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
Iterator e= model.getAnnotationIterator(); Iterator e= model.getAnnotationIterator();
while (e.hasNext()) { while (e.hasNext()) {
Object annotation= e.next(); Object annotation= e.next();

View file

@ -91,7 +91,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
* if there isn't any initial selection. * if there isn't any initial selection.
* @return the first element of the initial selection. * @return the first element of the initial selection.
*/ */
@SuppressWarnings({ "unchecked" }) @SuppressWarnings({ "rawtypes" })
protected Object getPrimaryInitialSelection() { protected Object getPrimaryInitialSelection() {
List result= getInitialElementSelections(); List result= getInitialElementSelections();
if (result == null || result.size() == 0) if (result == null || result.size() == 0)

View file

@ -62,7 +62,6 @@ public class BuildGroup extends CViewActionGroup {
super(shell, kind); super(shell, kind);
} }
@Override @Override
@SuppressWarnings("unchecked")
public void run() { public void run() {
// Ensure we correctly save files in all referenced projects before build // Ensure we correctly save files in all referenced projects before build
Set<IProject> prjs = new HashSet<IProject>(); Set<IProject> prjs = new HashSet<IProject>();

View file

@ -59,7 +59,7 @@ public class DisassemblyDisplayModeHandler extends AbstractHandler implements IE
* @see org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui.menus.UIElement, java.util.Map) * @see org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui.menus.UIElement, java.util.Map)
*/ */
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public void updateElement( UIElement element, Map parameters ) { public void updateElement( UIElement element, Map parameters ) {
IWorkbenchPartSite site = element.getServiceLocator().getService( IWorkbenchPartSite.class ); IWorkbenchPartSite site = element.getServiceLocator().getService( IWorkbenchPartSite.class );
if ( site != null ) { if ( site != null ) {

View file

@ -68,7 +68,7 @@ public class SetSteppingModeHandler extends AbstractHandler implements IElementU
* @see org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui.menus.UIElement, java.util.Map) * @see org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui.menus.UIElement, java.util.Map)
*/ */
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public void updateElement( UIElement element, Map parameters ) { public void updateElement( UIElement element, Map parameters ) {
String param = (String)parameters.get( ID_PARAMETER_MODE ); String param = (String)parameters.get( ID_PARAMETER_MODE );
if ( param != null ) { if ( param != null ) {

View file

@ -359,7 +359,7 @@ public class DisassemblyPane implements IPropertyChangeListener {
return EditorsUI.getSharedTextColors(); return EditorsUI.getSharedTextColors();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
protected IVerticalRuler createCompositeRuler() { protected IVerticalRuler createCompositeRuler() {
CompositeRuler ruler = new CompositeRuler(); CompositeRuler ruler = new CompositeRuler();
ruler.addDecorator( 0, new AnnotationRulerColumn( VERTICAL_RULER_WIDTH, getAnnotationAccess() ) ); ruler.addDecorator( 0, new AnnotationRulerColumn( VERTICAL_RULER_WIDTH, getAnnotationAccess() ) );

View file

@ -196,7 +196,7 @@ public class VirtualDocument extends Document {
getAnnotationProvider().update( getContentProvider().getInput(), element, index, getPresentationContext() ); getAnnotationProvider().update( getContentProvider().getInput(), element, index, getPresentationContext() );
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
protected void updateAnnotations( int lineNumber, Annotation[] annotations ) { protected void updateAnnotations( int lineNumber, Annotation[] annotations ) {
IAnnotationModel annotationModel = getAnnotationModel(); IAnnotationModel annotationModel = getAnnotationModel();
try { try {

View file

@ -59,7 +59,6 @@ public class DsfTestBreakpointAttributeTranslator2 implements IBreakpointAttribu
public Map<String, Object> getAllBreakpointAttributes(IBreakpoint platformBP, boolean bpManagerEnabled) public Map<String, Object> getAllBreakpointAttributes(IBreakpoint platformBP, boolean bpManagerEnabled)
throws CoreException throws CoreException
{ {
@SuppressWarnings("unchecked")
Map<String, Object> platformBPAttr = platformBP.getMarker().getAttributes(); Map<String, Object> platformBPAttr = platformBP.getMarker().getAttributes();
if (!bpManagerEnabled) { if (!bpManagerEnabled) {
platformBPAttr.put(IBreakpoint.ENABLED, Boolean.FALSE); platformBPAttr.put(IBreakpoint.ENABLED, Boolean.FALSE);

View file

@ -113,7 +113,6 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
this(launch.getSession(), getAttributes(launch), rm); this(launch.getSession(), getAttributes(launch), rm);
} }
@SuppressWarnings("unchecked")
private static Map<String, Object> getAttributes(GdbLaunch launch) { private static Map<String, Object> getAttributes(GdbLaunch launch) {
try { try {
return launch.getLaunchConfiguration().getAttributes(); return launch.getLaunchConfiguration().getAttributes();

View file

@ -48,7 +48,7 @@ class ParserState {
/** /**
* Trial actions that have been executed but not yet committed. * Trial actions that have been executed but not yet committed.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public LinkedList pendingCommits; public LinkedList pendingCommits;
public ConfigurationStack configurationStack; public ConfigurationStack configurationStack;

View file

@ -211,7 +211,6 @@ public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegat
* @param mode mode * @param mode mode
* @return launch delegate * @return launch delegate
*/ */
@SuppressWarnings("unchecked")
private ILaunchConfigurationDelegate2 getPreferredDelegate(ILaunchConfiguration config, String mode) throws CoreException { private ILaunchConfigurationDelegate2 getPreferredDelegate(ILaunchConfiguration config, String mode) throws CoreException {
ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager(); ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType localCfg = ILaunchConfigurationType localCfg =

View file

@ -64,7 +64,7 @@ public class UPCLanguage extends BaseExtensibleLanguage {
private static final ICLanguageKeywords upcKeywords = new UPCLanguageKeywords(ScannerExtensionConfiguration.createC()); private static final ICLanguageKeywords upcKeywords = new UPCLanguageKeywords(ScannerExtensionConfiguration.createC());
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if(ICLanguageKeywords.class.equals(adapter)) if(ICLanguageKeywords.class.equals(adapter))

View file

@ -59,7 +59,7 @@ public class XlcCLanguage extends GCCLanguage {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if(ICLanguageKeywords.class.equals(adapter)) if(ICLanguageKeywords.class.equals(adapter))

View file

@ -87,7 +87,7 @@ public class XlcCPPLanguage extends GPPLanguage {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
@Override @Override
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
if(ICLanguageKeywords.class.equals(adapter)) if(ICLanguageKeywords.class.equals(adapter))