Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-12-14 06:49:09 +0000
committerAlexander Kurtakov2015-12-14 06:49:09 +0000
commit34281a96e0e6e4c72938b4c0beb46a361d17f696 (patch)
tree98275d54052eed72b5a907abe3262058c811bb7e
parentaf49d7701ab719a7176ad941bc91b956931c8133 (diff)
downloadorg.eclipse.cdt-34281a96e0e6e4c72938b4c0beb46a361d17f696.tar.gz
org.eclipse.cdt-34281a96e0e6e4c72938b4c0beb46a361d17f696.tar.xz
org.eclipse.cdt-34281a96e0e6e4c72938b4c0beb46a361d17f696.zip
autotools: Additional generification.
Properly generify now that o.e.text is generified. This alows removing a number of suppressed warnings. In a few places it is better to use wildcard than suppressing warnings. Also remove DefaultNoDependencyCalculator as it was suppressing warnings but better to remove directly as it's not use anywhere. Change-Id: I70c4ac073ce5b6c2a45443372037fa61b7c36c76 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java45
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java3
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java3
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java3
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java10
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java5
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java3
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/HTMLTextPresenter.java5
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/autoconf/ProjectionFileUpdater.java9
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeDocumentProvider.java3
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeEditor.java5
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileAnnotationHover.java25
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileDocumentProvider.java3
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java7
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/OpenIncludeAction.java3
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/ProjectionMakefileUpdater.java12
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/SelectionStatusDialog.java8
18 files changed, 46 insertions, 108 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
index a28ae58b4df..34ed7bbdc58 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
@@ -47,7 +47,7 @@ public class AutotoolsConfigurationBuilder extends ACBuilder {
}
@Override
- protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map args, IProgressMonitor monitor)
+ protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor)
throws CoreException {
IProject project = getProject();
if(!isCdtProjectCreated(project))
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java
deleted file mode 100644
index b2db65c21df..00000000000
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.internal.autotools.core;
-
-import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
-import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-
-/**
- * This is the dependency calculator used by the makefile generation system when
- * nothing is defined for a tool.
- *
- * @since 2.0
- */
-@SuppressWarnings("deprecation")
-public class DefaultNoDependencyCalculator implements IManagedDependencyGenerator {
-
- @Override
- public IResource[] findDependencies(IResource resource, IProject project) {
- // Never answers any dependencies
- return null;
- }
-
- @Override
- public int getCalculatorType() {
- return TYPE_NODEPS;
- }
-
- @Override
- public String getDependencyCommand(IResource resource, IManagedBuildInfo info) {
- // Never answers this call with an actual value
- return null;
- }
-
-}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
index 667199ceca4..5a89da37ee0 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
@@ -29,11 +29,10 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
this.value = name;
}
- @SuppressWarnings("unchecked")
private FlagConfigureOption(String name, AutotoolsConfiguration cfg, String value, ArrayList<String> children) {
super(name, cfg);
this.value = value;
- this.children = (ArrayList<String>) children.clone();
+ this.children = new ArrayList<>(children);
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
index 03a3ac06ea3..f220d182be8 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
@@ -75,8 +75,7 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
List<Annotation> exact= new ArrayList<>();
List<Annotation> including= new ArrayList<>();
- @SuppressWarnings("rawtypes")
- Iterator e= model.getAnnotationIterator();
+ Iterator<?> e = model.getAnnotationIterator();
while (e.hasNext()) {
Object o= e.next();
if (o instanceof Annotation) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
index 3ebef522561..811eb02d627 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
@@ -18,8 +18,7 @@ import org.eclipse.ui.editors.text.TextFileDocumentProvider;
public class AutoconfDocumentProvider extends TextFileDocumentProvider {
public void shutdown() {
- @SuppressWarnings("rawtypes")
- Iterator e= getConnectedElementsIterator();
+ Iterator<?> e = getConnectedElementsIterator();
while (e.hasNext())
disconnect(e.next());
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
index d20c2c08b86..ce76f7732e8 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
@@ -185,18 +185,18 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
}
}
- @Override
- @SuppressWarnings({ "rawtypes" })
- public Object getAdapter(Class required) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Class<T> required) {
if (ProjectionAnnotationModel.class.equals(required)) {
if (fProjectionSupport != null) {
Object result = fProjectionSupport.getAdapter(getSourceViewer(), required);
if (result != null) {
- return result;
+ return (T) result;
}
}
} else if (IContentOutlinePage.class.equals(required)) {
- return getOutlinePage();
+ return (T) getOutlinePage();
}
return super.getAdapter(required);
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java
index cdc416cfcba..510df4cffdd 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java
@@ -87,10 +87,9 @@ public class AutoconfErrorHandler implements IAutoconfErrorHandler {
public void removeExistingMarkers(int offset, int length)
{
- @SuppressWarnings("rawtypes")
- Iterator i = fAnnotationModel.getAnnotationIterator();
+ Iterator<Annotation> i = fAnnotationModel.getAnnotationIterator();
while (i.hasNext()) {
- Annotation annotation = (Annotation)i.next();
+ Annotation annotation = i.next();
Position p = fAnnotationModel.getPosition(annotation);
int pStart = p.getOffset();
if (pStart >= offset && pStart < (offset + length)) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
index e3ef7f3bdfa..8954a7a941b 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
@@ -49,8 +49,7 @@ public class AutoconfContentOutlinePage extends ContentOutlinePage {
protected ISelection updateSelection(ISelection sel) {
ArrayList<AutoconfElement> newSelection= new ArrayList<>();
if (sel instanceof IStructuredSelection) {
- @SuppressWarnings("rawtypes")
- Iterator iter= ((IStructuredSelection)sel).iterator();
+ Iterator<?> iter = ((IStructuredSelection) sel).iterator();
for (;iter.hasNext();) {
//ICElement elem= fInput.findEqualMember((ICElement)iter.next());
Object o = iter.next();
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/HTMLTextPresenter.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/HTMLTextPresenter.java
index 1080351ead9..21405fe2b6d 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/HTMLTextPresenter.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/HTMLTextPresenter.java
@@ -49,11 +49,10 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
int yoursStart= offset;
- @SuppressWarnings("rawtypes")
- Iterator e= presentation.getAllStyleRangeIterator();
+ Iterator<StyleRange> e = presentation.getAllStyleRangeIterator();
while (e.hasNext()) {
- StyleRange range= (StyleRange) e.next();
+ StyleRange range= e.next();
int myStart= range.start;
int myEnd= range.start + range.length -1;
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/autoconf/ProjectionFileUpdater.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
index b04aabb6664..b611a40dc05 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
@@ -157,7 +157,7 @@ public class ProjectionFileUpdater implements IProjectionListener {
AutoconfElement fInput= fEditor.getRootElement();
if (fInput != null) {
- ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ ProjectionAnnotationModel model = fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model != null) {
Map<AutoconfProjectionAnnotation, Position> additions= computeAdditions(fInput);
model.removeAllAnnotations();
@@ -262,7 +262,7 @@ public class ProjectionFileUpdater implements IProjectionListener {
if (!isInstalled())
return;
- ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ ProjectionAnnotationModel model= fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model == null)
return;
@@ -398,10 +398,9 @@ public class ProjectionFileUpdater implements IProjectionListener {
private Map<AutoconfElement, List<AutoconfProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
Map<AutoconfElement, List<AutoconfProjectionAnnotation>> map= new HashMap<>();
- @SuppressWarnings("rawtypes")
- Iterator e= model.getAnnotationIterator();
+ Iterator<Annotation> e = model.getAnnotationIterator();
while (e.hasNext()) {
- Object annotation= e.next();
+ Annotation annotation = e.next();
if (annotation instanceof AutoconfProjectionAnnotation) {
AutoconfProjectionAnnotation directive= (AutoconfProjectionAnnotation) annotation;
List<AutoconfProjectionAnnotation> list= map.get(directive.getElement());
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeDocumentProvider.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeDocumentProvider.java
index 373b65fd12d..1f87019b739 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeDocumentProvider.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeDocumentProvider.java
@@ -89,8 +89,7 @@ public class AutomakeDocumentProvider extends TextFileDocumentProvider implement
@Override
public void shutdown() {
- @SuppressWarnings("rawtypes")
- Iterator e= getConnectedElementsIterator();
+ Iterator<?> e = getConnectedElementsIterator();
while (e.hasNext())
disconnect(e.next());
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeEditor.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeEditor.java
index 71c7445de56..16ede483041 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeEditor.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeEditor.java
@@ -90,10 +90,11 @@ public class AutomakeEditor extends MakefileEditor {
return ampage;
}
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
+ public <T> T getAdapter(Class<T> key) {
if (key.equals(IContentOutlinePage.class)) {
- return getAutomakeOutlinePage();
+ return (T) getAutomakeOutlinePage();
}
return super.getAdapter(key);
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileAnnotationHover.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileAnnotationHover.java
index be5d726c704..6ba988ac297 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileAnnotationHover.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileAnnotationHover.java
@@ -92,29 +92,22 @@ public class MakefileAnnotationHover implements IAnnotationHover, IAnnotationHov
List<Annotation> exact= new ArrayList<>();
List<Annotation> including= new ArrayList<>();
- @SuppressWarnings("rawtypes")
- Iterator e= model.getAnnotationIterator();
+ Iterator<Annotation> e = model.getAnnotationIterator();
while (e.hasNext()) {
- Object o= e.next();
- if (o instanceof Annotation) {
- Annotation a= (Annotation) o;
- switch (compareRulerLine(model.getPosition(a), document, line)) {
- case 1:
- exact.add(a);
- break;
- case 2:
- including.add(a);
- break;
- }
+ Annotation a = e.next();
+ switch (compareRulerLine(model.getPosition(a), document, line)) {
+ case 1:
+ exact.add(a);
+ break;
+ case 2:
+ including.add(a);
+ break;
}
}
return select(exact, including);
}
- /*
- * @see IVerticalRulerHover#getHoverInfo(ISourceViewer, int)
- */
@Override
public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
List<Annotation> annotations = getAnnotationsForLine(sourceViewer, lineNumber);
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileDocumentProvider.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileDocumentProvider.java
index 763884e8979..d61ab3d252d 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileDocumentProvider.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileDocumentProvider.java
@@ -125,8 +125,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
@Override
public void shutdown() {
- @SuppressWarnings("rawtypes")
- Iterator e= getConnectedElementsIterator();
+ Iterator<?> e = getConnectedElementsIterator();
while (e.hasNext())
disconnect(e.next());
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java
index 54c8243c4ea..c0f0cf26a0f 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefileEditor.java
@@ -158,17 +158,18 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
return viewer;
}
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(@SuppressWarnings("rawtypes") Class key) {
+ public <T> T getAdapter(Class<T> key) {
if (ProjectionAnnotationModel.class.equals(key)) {
if (projectionSupport != null) {
Object result = projectionSupport.getAdapter(getSourceViewer(), key);
if (result != null) {
- return result;
+ return (T) result;
}
}
} else if (key.equals(IContentOutlinePage.class)) {
- return getOutlinePage();
+ return (T) getOutlinePage();
}
return super.getAdapter(key);
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/OpenIncludeAction.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/OpenIncludeAction.java
index 2a593916fff..929245dd5a9 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/OpenIncludeAction.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/OpenIncludeAction.java
@@ -269,8 +269,7 @@ public class OpenIncludeAction extends Action {
private static IInclude getIncludeStatement(ISelection sel) {
if (!sel.isEmpty() && sel instanceof IStructuredSelection) {
- @SuppressWarnings("rawtypes")
- List list= ((IStructuredSelection)sel).toList();
+ List<?> list = ((IStructuredSelection) sel).toList();
if (list.size() == 1) {
Object element= list.get(0);
if (element instanceof IInclude) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/ProjectionMakefileUpdater.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
index 8ea06ec2d5b..042c99c55a5 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
@@ -149,10 +149,9 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
fInput= manager.getWorkingCopy(fEditor.getEditorInput());
if (fInput != null) {
- ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ ProjectionAnnotationModel model = fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model != null) {
- @SuppressWarnings("rawtypes")
- Map additions= computeAdditions((IParent) fInput);
+ Map<MakefileProjectionAnnotation, Position> additions = computeAdditions((IParent) fInput);
model.removeAllAnnotations();
model.replaceAnnotations(null, additions);
}
@@ -235,7 +234,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
if (!isInstalled())
return;
- ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ ProjectionAnnotationModel model= fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model == null)
return;
@@ -371,10 +370,9 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
private Map<IDirective, List<MakefileProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
Map<IDirective, List<MakefileProjectionAnnotation>> map= new HashMap<>();
- @SuppressWarnings("rawtypes")
- Iterator e= model.getAnnotationIterator();
+ Iterator<Annotation> e = model.getAnnotationIterator();
while (e.hasNext()) {
- Object annotation= e.next();
+ Annotation annotation = e.next();
if (annotation instanceof MakefileProjectionAnnotation) {
MakefileProjectionAnnotation directive= (MakefileProjectionAnnotation) annotation;
List<MakefileProjectionAnnotation> list= map.get(directive.getElement());
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/SelectionStatusDialog.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/SelectionStatusDialog.java
index 675ec4b8b46..df5a3264dbb 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/SelectionStatusDialog.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/SelectionStatusDialog.java
@@ -83,9 +83,8 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
* if there isn't any initial selection.
* @return the first element of the initial selection.
*/
- @SuppressWarnings({ "rawtypes" })
protected Object getPrimaryInitialSelection() {
- List result= getInitialElementSelections();
+ List<?> result = getInitialElementSelections();
if (result == null || result.size() == 0)
return null;
return result.get(0);
@@ -120,9 +119,10 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
public void setImage(Image image) {
fImage= image;
}
- @SuppressWarnings({ "unchecked" })
+
+ @SuppressWarnings("unchecked")
protected void setInitialSelection(int position, Object element) {
- List l= getInitialElementSelections();
+ List<Object> l = getInitialElementSelections();
l.set(position, element);
fInitialSelectionSet= true;
}

Back to the top