From 4fe00329b1180d4306fd7375f9f95d290d25e29d Mon Sep 17 00:00:00 2001
From: Andrew Gvozdev <angvoz.dev@gmail.com>
Date: Fri, 30 Apr 2010 05:27:43 +0000
Subject: [PATCH] compilation warnings

---
 .../ui/compare/MakefileMergeViewer.java       | 11 ++++----
 .../ui/editor/MakefileDocumentProvider.java   | 19 +++++++-------
 .../MakefileEditorPreferencePage.java         | 25 +++++++++----------
 .../ui/text/CompletionProposalComparator.java |  8 +++---
 .../makefile/MakefileCompletionProcessor.java | 12 ++++-----
 5 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/compare/MakefileMergeViewer.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/compare/MakefileMergeViewer.java
index 3a3dbf9936a..c72364c8db6 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/compare/MakefileMergeViewer.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/compare/MakefileMergeViewer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2010 Wind River Systems, Inc. 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
@@ -57,10 +57,6 @@ public class MakefileMergeViewer extends TextMergeViewer {
 
 	/**
 	 * Create a new merge viewer.
-	 * 
-	 * @param parent
-	 * @param style
-	 * @param configuration
 	 */
 	public MakefileMergeViewer(Composite parent, int style, CompareConfiguration configuration) {
 		super(parent, style | SWT.LEFT_TO_RIGHT, configuration);
@@ -90,6 +86,7 @@ public class MakefileMergeViewer extends TextMergeViewer {
 		return fPreferenceStore;
 	}
 
+	@Override
 	protected void handleDispose(DisposeEvent event) {
 		if (fPreferenceChangeListener != null) {
 			fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
@@ -133,14 +130,17 @@ public class MakefileMergeViewer extends TextMergeViewer {
 
 	}
 
+	@Override
 	protected String getDocumentPartitioning() {
 		return MakefileDocumentSetupParticipant.MAKEFILE_PARTITIONING;
 	}
 
+	@Override
 	protected IDocumentPartitioner getDocumentPartitioner() {
 		return new FastPartitioner(new MakefilePartitionScanner(), MakefilePartitionScanner.MAKE_PARTITIONS);
 	}
 
+	@Override
 	protected void configureTextViewer(TextViewer textViewer) {
 		if (textViewer instanceof SourceViewer) {
 			((SourceViewer)textViewer).configure(getSourceViewerConfiguration());
@@ -150,6 +150,7 @@ public class MakefileMergeViewer extends TextMergeViewer {
 	/*
 	 * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getTitle()
 	 */
+	@Override
 	public String getTitle() {
 		return MakeUIPlugin.getResourceString("MakefileMergeViewer.title"); //$NON-NLS-1$
 	}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java
index 0d71f170d50..9cefb2325c3 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 QNX Software Systems and others.
+ * Copyright (c) 2000, 2010 QNX Software Systems 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
@@ -31,16 +31,10 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
 	IMakefile fMakefile;
 
 	protected class MakefileAnnotationModel extends ResourceMarkerAnnotationModel /*implements IProblemRequestor */{
-		/**
-		 * @param resource
-		 */
 		public MakefileAnnotationModel(IResource resource) {
 			super(resource);
 		}
 
-		/**
-		 * @param makefile
-		 */
 		public void setMakefile(IMakefile makefile) {
 			fMakefile = makefile;
 		}
@@ -71,13 +65,15 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
     /* (non-Javadoc)
      * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createAnnotationModel(org.eclipse.core.resources.IFile)
      */
-    protected IAnnotationModel createAnnotationModel(IFile file) {
+    @Override
+	protected IAnnotationModel createAnnotationModel(IFile file) {
     	return new MakefileAnnotationModel(file);
     }
 
     /*
 	 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createFileInfo(java.lang.Object)
 	 */
+	@Override
 	protected FileInfo createFileInfo(Object element) throws CoreException {
 		if (!(element instanceof IFileEditorInput))
 			return null;
@@ -107,7 +103,8 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
     /* (non-Javadoc)
      * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#disposeFileInfo(java.lang.Object, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo)
      */
-    protected void disposeFileInfo(Object element, FileInfo info) {
+    @Override
+	protected void disposeFileInfo(Object element, FileInfo info) {
 	    if (info instanceof MakefileFileInfo) {
 		    MakefileFileInfo makefileInfo= (MakefileFileInfo) info;
 		    if (makefileInfo.fCopy != null) {
@@ -120,6 +117,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
     /*
 	 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createEmptyFileInfo()
 	 */
+	@Override
 	protected FileInfo createEmptyFileInfo() {
 		return new MakefileFileInfo();
 	}
@@ -140,7 +138,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
 	 * @see org.eclipse.cdt.make.internal.ui.IMakefileDocumentProvider#shutdown()
 	 */
 	public void shutdown() {
-		Iterator e= getConnectedElementsIterator();
+		Iterator<?> e= getConnectedElementsIterator();
 		while (e.hasNext())
 			disconnect(e.next());
 	}
@@ -148,6 +146,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
 	/*
 	 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createSaveOperation(java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
 	 */
+	@Override
 	protected DocumentProviderOperation createSaveOperation(Object element, IDocument document, boolean overwrite)
 			throws CoreException {
 		if (!(element instanceof IFileEditorInput)) {
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java
index 216f23cd6c4..bc91186dbe7 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakefileEditorPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2008 QNX Software Systems and others.
+ * Copyright (c) 2002, 2010 QNX Software Systems 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
@@ -14,9 +14,10 @@
 package org.eclipse.cdt.make.internal.ui.preferences;
 
 import java.util.ArrayList;
-import java.util.Map;
+import java.util.List;
 
 import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
+import org.eclipse.cdt.make.internal.ui.preferences.OverlayPreferenceStore.OverlayKey;
 import org.eclipse.cdt.make.internal.ui.text.ColorManager;
 import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
 import org.eclipse.cdt.ui.PreferenceConstants;
@@ -58,7 +59,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 	private String[][] fSyntaxColorListModel;
 
 	private TableViewer fHighlightingColorListViewer;
-	private final java.util.List fHighlightingColorList= new ArrayList(5);
+	private final List<HighlightingColorListItem> fHighlightingColorList= new ArrayList<HighlightingColorListItem>(5);
 
 	Button fAppearanceColorDefault;
 	ColorSelector fSyntaxForegroundColorEditor;
@@ -67,10 +68,6 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 	
 	// folding
 	protected Button fFoldingCheckbox;
-	
-	protected Map fWorkingValues;
-	protected ArrayList fComboBoxes;
-	
 
 	/**
 	 * Item in the highlighting color list.
@@ -152,6 +149,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 		/*
 		 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
 		 */
+		@Override
 		public String getText(Object element) {
 			return ((HighlightingColorListItem)element).getDisplayName();
 		}
@@ -182,7 +180,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 		 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
 		 */
 		public Object[] getElements(Object inputElement) {
-			return ((java.util.List)inputElement).toArray();
+			return ((List<?>)inputElement).toArray();
 		}
 
 		/*
@@ -207,6 +205,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 		super();
 	}
 
+	@Override
 	protected OverlayPreferenceStore createOverlayStore() {
 		fSyntaxColorListModel= new String[][] {
 				{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_comment"), ColorManager.MAKE_COMMENT_COLOR, null}, //$NON-NLS-1$
@@ -216,7 +215,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 				{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_keyword"),  ColorManager.MAKE_KEYWORD_COLOR, null},  //$NON-NLS-1$
 				{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_default"),  ColorManager.MAKE_DEFAULT_COLOR, null},  //$NON-NLS-1$
 			};
-		ArrayList overlayKeys= new ArrayList();
+		ArrayList<OverlayKey> overlayKeys= new ArrayList<OverlayKey>();
 
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED));
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, MakefileEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL));
@@ -233,7 +232,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 		return new OverlayPreferenceStore(getPreferenceStore(), keys);
 	}
 
-	private void addTextKeyToCover(ArrayList overlayKeys, String mainKey) {
+	private void addTextKeyToCover(ArrayList<OverlayKey> overlayKeys, String mainKey) {
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey));
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + MakefileEditorPreferenceConstants.EDITOR_BOLD_SUFFIX));
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + MakefileEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX));
@@ -242,6 +241,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 	/* (non-Javadoc)
 	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
 	 */
+	@Override
 	protected Control createContents(Composite parent) {
 		MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
 		getOverlayStore().load();
@@ -294,6 +294,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 	/* (non-Javadoc)
 	 * @see org.eclipse.ant.internal.ui.preferences.AbstractMakefileEditorPreferencePage#handleDefaults()
 	 */
+	@Override
 	protected void handleDefaults() {
 		handleSyntaxColorListSelection();
 		initializeDefaultFolding();
@@ -451,13 +452,11 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
 	/* (non-Javadoc)
 	 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
 	 */
+	@Override
 	public boolean performOk() {
 		return super.performOk();
 	}
 
-	/**
-	 * @param preferenceStore
-	 */
 	public static void initDefaults(IPreferenceStore prefs) {		
 		// Makefile Editor color preferences
 		PreferenceConverter.setDefault(prefs, ColorManager.MAKE_COMMENT_COLOR, ColorManager.MAKE_COMMENT_RGB);
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java
index 6c2f3c9ac93..36eba46952d 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * Copyright (c) 2000, 2010 QNX Software Systems 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
@@ -15,7 +15,7 @@ import java.util.Comparator;
 
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 
-public class CompletionProposalComparator implements Comparator {
+public class CompletionProposalComparator implements Comparator<ICompletionProposal> {
 
 	/**
 	 * Constructor for CompletionProposalComparator.
@@ -26,9 +26,7 @@ public class CompletionProposalComparator implements Comparator {
 	/* (non-Javadoc)
 	 * @see Comparator#compare(Object, Object)
 	 */
-	public int compare(Object o1, Object o2) {
-		ICompletionProposal c1= (ICompletionProposal) o1;
-		ICompletionProposal c2= (ICompletionProposal) o2;
+	public int compare(ICompletionProposal c1, ICompletionProposal c2) {
 		return c1.getDisplayString().compareToIgnoreCase(c2.getDisplayString());
 	}	
 	
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java
index d5fe090863a..5b0caedff70 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * Copyright (c) 2000, 2010 QNX Software Systems 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
@@ -70,7 +70,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
 		}
 	}
 
-	public class DirectiveComparator implements Comparator {
+	public class DirectiveComparator implements Comparator<Object> {
 
 		/* (non-Javadoc)
 		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
@@ -131,7 +131,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
 			statements = makefile.getTargetRules();
 		}
 
-		ArrayList proposalList = new ArrayList(statements.length);
+		ArrayList<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(statements.length);
 
 		// iterate over all the different categories
 		for (int i = 0; i < statements.length; i++) {
@@ -163,7 +163,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
 				proposalList.add(result);
 			}
 		}
-		ICompletionProposal[] proposals = (ICompletionProposal[]) proposalList.toArray(new ICompletionProposal[0]);
+		ICompletionProposal[] proposals = proposalList.toArray(new ICompletionProposal[0]);
 		Arrays.sort(proposals, comparator);
 		return proposals;
 	}
@@ -175,7 +175,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
 		WordPartDetector wordPart = new WordPartDetector(viewer, documentOffset);
 		boolean macro = WordPartDetector.inMacro(viewer, documentOffset);
 		IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
-		ArrayList contextList = new ArrayList();
+		ArrayList<String> contextList = new ArrayList<String>();
 		if (macro) {
 			IDirective[] statements = makefile.getMacroDefinitions();
 			for (int i = 0; i < statements.length; i++) {
@@ -205,7 +205,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
 
 		IContextInformation[] result = new IContextInformation[contextList.size()];
 		for (int i = 0; i < result.length; i++) {
-			String context = (String)contextList.get(i);
+			String context = contextList.get(i);
 			result[i] = new ContextInformation(imageMacro, wordPart.toString(), context);
 		}
 		return result;