From 88ba647612fc0ec4796246d4b52c751ad0c46df7 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Thu, 18 Feb 2010 08:16:21 +0000 Subject: [PATCH] Compiler warnings. --- .../cdt/core/model/AbstractLanguage.java | 14 +++--- .../cdt/core/model/AssemblyLanguage.java | 16 ++++--- .../org/eclipse/cdt/core/model/ILanguage.java | 17 +++---- .../model/util/PathEntryTranslator.java | 14 +++--- .../model/util/ResourceChangeHandlerBase.java | 46 ++++++++++--------- .../model/AbstractCExtensionProxy.java | 3 +- .../settings/model/ResourceChangeHandler.java | 44 +++++++++--------- .../parser/IncludeFileContentProvider.java | 5 +- .../indexer/StandaloneFastIndexerTask.java | 3 +- .../core/indexer/StandaloneFullIndexer.java | 3 +- .../indexer/StandaloneFullIndexerTask.java | 3 +- ...tandaloneIndexerFallbackReaderFactory.java | 3 +- .../core/parser/CodeReaderFactoryAdapter.java | 6 +-- .../parser/FileContentProviderAdapter.java | 8 ++-- .../eclipse/cdt/core/AbstractCExtension.java | 2 + .../cdt/core/dom/IASTServiceProvider.java | 6 ++- .../cdt/core/parser/CodeReaderCache.java | 3 +- .../eclipse/cdt/core/parser/ParserUtil.java | 3 +- .../core/dom/AbstractCodeReaderFactory.java | 3 +- .../core/dom/NullCodeReaderFactory.java | 3 +- .../PartialWorkingCopyCodeReaderFactory.java | 3 +- .../core/dom/SavedCodeReaderFactory.java | 3 +- .../dom/WorkingCopyCodeReaderFactory.java | 3 +- 23 files changed, 115 insertions(+), 99 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AbstractLanguage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AbstractLanguage.java index f003c52e198..e81ad217de8 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AbstractLanguage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AbstractLanguage.java @@ -11,7 +11,6 @@ *******************************************************************************/ package org.eclipse.cdt.core.model; -import org.eclipse.cdt.core.dom.ICodeReaderFactory; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.index.IIndex; @@ -20,7 +19,6 @@ import org.eclipse.cdt.core.parser.IParserLogService; import org.eclipse.cdt.core.parser.IScannerInfo; import org.eclipse.cdt.core.parser.IncludeFileContentProvider; import org.eclipse.cdt.internal.core.parser.CodeReaderAdapter; -import org.eclipse.cdt.internal.core.parser.CodeReaderFactoryAdapter; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.PlatformObject; @@ -47,7 +45,7 @@ public abstract class AbstractLanguage extends PlatformObject implements ILangua @Deprecated public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, IScannerInfo scanInfo, - ICodeReaderFactory fileCreator, IIndex index, int options, IParserLogService log) + org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index, int options, IParserLogService log) throws CoreException { // For backwards compatibility, should be overridden. return getASTTranslationUnit(reader, scanInfo, fileCreator, index, log); @@ -61,8 +59,9 @@ public abstract class AbstractLanguage extends PlatformObject implements ILangua IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log) throws CoreException { // For backwards compatibility, should be overridden. - return getASTTranslationUnit(CodeReaderAdapter.adapt(content), scanInfo, CodeReaderFactoryAdapter - .adapt(fileCreator), index, options, log); + return getASTTranslationUnit(CodeReaderAdapter.adapt(content), scanInfo, + org.eclipse.cdt.internal.core.parser.CodeReaderFactoryAdapter.adapt(fileCreator), index, + options, log); } /** @@ -73,7 +72,8 @@ public abstract class AbstractLanguage extends PlatformObject implements ILangua IncludeFileContentProvider fileCreator, IIndex index, IParserLogService log, int offset) throws CoreException { // For backwards compatibility, should be overridden. - return getCompletionNode(CodeReaderAdapter.adapt(reader), scanInfo, CodeReaderFactoryAdapter - .adapt(fileCreator), index, log, offset); + return getCompletionNode(CodeReaderAdapter.adapt(reader), scanInfo, + org.eclipse.cdt.internal.core.parser.CodeReaderFactoryAdapter.adapt(fileCreator), index, log, + offset); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AssemblyLanguage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AssemblyLanguage.java index d1f2731633b..e11443a07f5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AssemblyLanguage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/AssemblyLanguage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 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 @@ -13,13 +13,11 @@ package org.eclipse.cdt.core.model; import java.util.Set; import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.dom.ICodeReaderFactory; import org.eclipse.cdt.core.dom.ILinkage; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.index.IIndex; -import org.eclipse.cdt.core.parser.CodeReader; import org.eclipse.cdt.core.parser.IParserLogService; import org.eclipse.cdt.core.parser.IScannerInfo; import org.eclipse.cdt.core.parser.KeywordSetKey; @@ -83,16 +81,20 @@ public class AssemblyLanguage extends AbstractLanguage implements IAsmLanguage, /* * @see org.eclipse.cdt.core.model.ILanguage#getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader, org.eclipse.cdt.core.parser.IScannerInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory, org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.parser.IParserLogService) */ - public IASTTranslationUnit getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo, - ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) throws CoreException { + @Deprecated + public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, + IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index, + IParserLogService log) throws CoreException { return null; } /* * @see org.eclipse.cdt.core.model.ILanguage#getCompletionNode(org.eclipse.cdt.core.parser.CodeReader, org.eclipse.cdt.core.parser.IScannerInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory, org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.parser.IParserLogService, int) */ - public IASTCompletionNode getCompletionNode(CodeReader reader, IScannerInfo scanInfo, - ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset) throws CoreException { + @Deprecated + public IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader, + IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index, + IParserLogService log, int offset) throws CoreException { return null; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILanguage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILanguage.java index e49392aecb9..53c13650a50 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILanguage.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILanguage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 QNX Software Systems and others. + * Copyright (c) 2005, 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 @@ -12,7 +12,6 @@ *******************************************************************************/ package org.eclipse.cdt.core.model; -import org.eclipse.cdt.core.dom.ICodeReaderFactory; import org.eclipse.cdt.core.dom.ILinkage; import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; @@ -154,22 +153,24 @@ public interface ILanguage extends IAdaptable { */ @Deprecated IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, - IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) - throws CoreException; + IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index, + IParserLogService log) throws CoreException; + /** * @deprecated replaced by {@link #getASTTranslationUnit(FileContent, IScannerInfo, * IncludeFileContentProvider, IIndex, int, IParserLogService)} */ @Deprecated IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, - IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, int options, - IParserLogService log) throws CoreException; + IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index, + int options, IParserLogService log) throws CoreException; + /** * @deprecated replaced by {@link #getCompletionNode(FileContent, IScannerInfo, * IncludeFileContentProvider, IIndex, IParserLogService, int)}. */ @Deprecated IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader, - IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, - int offset) throws CoreException; + IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index, + IParserLogService log, int offset) throws CoreException; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java index 2f2ded5308e..8c5f556c146 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2010 Intel 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 @@ -214,6 +214,7 @@ public class PathEntryTranslator { }; // private static final int INEXISTENT_INDEX = -1; + @SuppressWarnings("unchecked") private Map[] fEntryStorage = new Map[STORAGE_SIZE]; private int kindToIndex(int kind){ @@ -1752,13 +1753,10 @@ public class PathEntryTranslator { private ResourceInfo[] performTranslation(IPath basePath, ResourceInfo[] baseInfos, String seg){ IPath filterFullPath = basePath.append(seg); boolean needsParsing = hasSpecChars(seg); - ResourceInfo baseInfo; List list = new ArrayList(); char[] segChars = seg.toCharArray(); - IResource baseRc; - for(int i = 0; i < baseInfos.length; i++){ - baseInfo = baseInfos[i]; - baseRc = baseInfo.fRc; + for (ResourceInfo baseInfo : baseInfos) { + IResource baseRc = baseInfo.fRc; if(baseRc.getType() == IResource.FILE){ continue; } else { @@ -1773,8 +1771,8 @@ public class PathEntryTranslator { IResource children[] = baseCr.members(); ResourceInfo rcInfo; for (IResource child : children) { - if(CoreModelUtil.match(segChars, children[i].getName().toCharArray(), true)){ - rcInfo = new ResourceInfo(children[i], true); + if(CoreModelUtil.match(segChars, child.getName().toCharArray(), true)){ + rcInfo = new ResourceInfo(child, true); addRcInfoToMap(rcInfo); list.add(rcInfo); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java index cf8b79aec48..af40175e8e9 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2010 Intel 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 @@ -82,30 +82,32 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen boolean removed = false; switch (delta.getKind()) { - case IResourceDelta.REMOVED : - removed = true; - case IResourceDelta.CHANGED : - int flags = delta.getFlags(); - if ((flags & IResourceDelta.MOVED_TO) != 0) { - IPath path = delta.getMovedToPath(); - if(path != null){ - IResource toRc = getResource(path, dResource); - resume = checkInitHandleResourceMove(dResource, toRc); - } - break; - } else if((flags & IResourceDelta.MOVED_FROM) != 0){ - IPath path = delta.getMovedFromPath(); - if(path != null){ - IResource fromRc = getResource(path, dResource); - resume = checkInitHandleResourceMove(fromRc, dResource); - } - break; - } else if (removed){ - resume = fHandler.handleResourceRemove(dResource); + case IResourceDelta.REMOVED: + removed = true; + //$FALL-THROUGH$ + case IResourceDelta.CHANGED: + int flags = delta.getFlags(); + if ((flags & IResourceDelta.MOVED_TO) != 0) { + IPath path = delta.getMovedToPath(); + if (path != null) { + IResource toRc = getResource(path, dResource); + resume = checkInitHandleResourceMove(dResource, toRc); } - default: break; + } else if ((flags & IResourceDelta.MOVED_FROM) != 0) { + IPath path = delta.getMovedFromPath(); + if (path != null) { + IResource fromRc = getResource(path, dResource); + resume = checkInitHandleResourceMove(fromRc, dResource); + } + break; + } else if (removed) { + resume = fHandler.handleResourceRemove(dResource); } + break; + default: + break; + } return resume; // visit the children diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java index 85bab74d64c..5e56471b559 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2010 Intel 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 @@ -158,6 +158,7 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis switch(event.getEventType()){ case CProjectDescriptionEvent.LOADED: force = true; + //$FALL-THROUGH$ case CProjectDescriptionEvent.APPLIED: ICProjectDescription des = event.getNewCProjectDescription(); if(des != null){ diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java index eca0b940dd1..187ea6bb869 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2010 Intel 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 @@ -18,11 +18,13 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.Map.Entry; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICExclusionPatternPathEntry; import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; import org.eclipse.cdt.core.settings.model.ICResourceDescription; import org.eclipse.cdt.core.settings.model.ICSourceEntry; import org.eclipse.cdt.core.settings.model.WriteAccessException; @@ -96,8 +98,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements ICProjectDescription des = getProjectDescription(toProject, true); if(des != null){ ICConfigurationDescription cfgDess[] = des.getConfigurations(); - for(int i = 0; i < cfgDess.length; i++){ - ICConfigurationDescription cfg = cfgDess[i]; + for (ICConfigurationDescription cfg : cfgDess) { ICExclusionPatternPathEntry entries[] = cfg.getSourceEntries(); entries = checkMove(fromFullPath, toFullPath, entries); if(entries != null){ @@ -134,8 +135,8 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements ICProjectDescription des = getProjectDescription(toProject, true); if(des != null){ ICConfigurationDescription cfgDess[] = des.getConfigurations(); - for(int i = 0; i < cfgDess.length; i++){ - ICResourceDescription rcDescription = cfgDess[i].getResourceDescription(fromRcProjPath, true); + for (ICConfigurationDescription cfgDes : cfgDess) { + ICResourceDescription rcDescription = cfgDes.getResourceDescription(fromRcProjPath, true); if(rcDescription != null){ try { rcDescription.setPath(toRcProjPath); @@ -156,9 +157,9 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements IProject project = rc.getProject(); ICProjectDescription des = fProjDesMap.get(project); if(des == null && !fProjDesMap.containsKey(project)){ - int flags = load ? 0 : CProjectDescriptionManager.GET_IF_LOADDED; + int flags = load ? 0 : ICProjectDescriptionManager.GET_IF_LOADDED; flags |= CProjectDescriptionManager.INTERNAL_GET_IGNORE_CLOSE; - flags |= CProjectDescriptionManager.GET_WRITABLE; + flags |= ICProjectDescriptionManager.GET_WRITABLE; des = fMngr.getProjectDescription(project, flags); if(des != null) fProjDesMap.put(project, des); @@ -166,15 +167,15 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements return des; } - private void setProjectDescription(IProject project, ICProjectDescription des){ - fProjDesMap.put(project, des); - } +// private void setProjectDescription(IProject project, ICProjectDescription des){ +// fProjDesMap.put(project, des); +// } private List checkRemove(IPath rcFullPath, ICExclusionPatternPathEntry[] entries){ List updatedList = null; int num = 0; - for(int k = 0; k < entries.length; k++){ - if(entries[k].getFullPath().equals(rcFullPath)){ + for (ICExclusionPatternPathEntry entrie : entries) { + if(entrie.getFullPath().equals(rcFullPath)){ if(updatedList == null){ updatedList = new ArrayList(Arrays.asList(entries)); } @@ -202,8 +203,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements if(des != null){ IPath rcFullPath = rc.getFullPath(); ICConfigurationDescription cfgDess[] = des.getConfigurations(); - for(int i = 0; i < cfgDess.length; i++){ - ICConfigurationDescription cfg = cfgDess[i]; + for (ICConfigurationDescription cfg : cfgDess) { ICExclusionPatternPathEntry[] entries = cfg.getSourceEntries(); List updatedList = checkRemove(rcFullPath, entries); @@ -235,11 +235,11 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements if(des != null){ IPath rcProjPath = rc.getProjectRelativePath(); ICConfigurationDescription cfgDess[] = des.getConfigurations(); - for(int i = 0; i < cfgDess.length; i++){ - ICResourceDescription rcDescription = cfgDess[i].getResourceDescription(rcProjPath, true); + for (ICConfigurationDescription cfgDes : cfgDess) { + ICResourceDescription rcDescription = cfgDes.getResourceDescription(rcProjPath, true); if(rcDescription != null){ try { - cfgDess[i].removeResourceDescription(rcDescription); + cfgDes.removeResourceDescription(rcDescription); } catch (WriteAccessException e) { CCorePlugin.log(e); } catch (CoreException e) { @@ -271,8 +271,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements CProjectDescriptionManager.runWspModification(new IWorkspaceRunnable(){ public void run(IProgressMonitor monitor) throws CoreException { - for(Iterator> iter = fProjDesMap.entrySet().iterator(); iter.hasNext();){ - Map.Entry entry = iter.next(); + for (Entry entry : fProjDesMap.entrySet()) { IProject project = entry.getKey(); if(!project.isOpen()) continue; @@ -337,8 +336,8 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements IResourceDelta delta = event.getDelta(); if(delta != null){ IResourceDelta projs[] = delta.getAffectedChildren(); - for(int i = 0; i < projs.length; i++){ - IResourceDelta projDelta = projs[i]; + for (IResourceDelta proj : projs) { + IResourceDelta projDelta = proj; if(!shouldVisit((IProject)projDelta.getResource())) continue; @@ -346,8 +345,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements continue; IResourceDelta children[] = projDelta.getAffectedChildren(); - for(int k = 0; k < children.length; k++){ - IResourceDelta child = children[k]; + for (IResourceDelta child : children) { IResource rc = child.getResource(); if(rc.getType() != IResource.FILE) continue; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IncludeFileContentProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IncludeFileContentProvider.java index 922aae7fddc..f4b322decca 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IncludeFileContentProvider.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IncludeFileContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Wind River Systems, Inc. and others. + * Copyright (c) 2009, 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 @@ -11,7 +11,6 @@ package org.eclipse.cdt.core.parser; import org.eclipse.cdt.internal.core.parser.EmptyFilesProvider; -import org.eclipse.cdt.internal.core.parser.FileContentProviderAdapter; import org.eclipse.cdt.internal.core.parser.SavedFilesProvider; @@ -44,6 +43,6 @@ public abstract class IncludeFileContentProvider { */ @Deprecated public static IncludeFileContentProvider adapt(org.eclipse.cdt.core.dom.ICodeReaderFactory factory) { - return FileContentProviderAdapter.adapt(factory); + return org.eclipse.cdt.internal.core.parser.FileContentProviderAdapter.adapt(factory); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFastIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFastIndexerTask.java index b783aad4c99..1c844d04683 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFastIndexerTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFastIndexerTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 QNX Software Systems and others. + * Copyright (c) 2006, 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 @@ -35,6 +35,7 @@ public class StandaloneFastIndexerTask extends StandaloneIndexerTask { super(indexer, added, changed, removed, true); } + @SuppressWarnings("deprecation") @Override protected IncludeFileContentProvider createReaderFactory() { return IncludeFileContentProvider.adapt(new StandaloneIndexerFallbackReaderFactory()); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexer.java index 04d7c584112..cc7c404de09 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 QNX Software Systems and others. + * Copyright (c) 2006, 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 @@ -40,6 +40,7 @@ import org.eclipse.core.runtime.CoreException; * * @since 4.0 */ +@SuppressWarnings("deprecation") public class StandaloneFullIndexer extends StandaloneIndexer{ private AbstractCodeReaderFactory fCodeReaderFactory; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexerTask.java index 9531feeddb2..303c4f68e0f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexerTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneFullIndexerTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 QNX Software Systems and others. + * Copyright (c) 2006, 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 @@ -36,6 +36,7 @@ public class StandaloneFullIndexerTask extends StandaloneIndexerTask { super(indexer, added, changed, removed, false); } + @SuppressWarnings("deprecation") @Override protected IncludeFileContentProvider createReaderFactory() { return IncludeFileContentProvider.adapt(((StandaloneFullIndexer)fIndexer).getCodeReaderFactory()); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerFallbackReaderFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerFallbackReaderFactory.java index 5e8d664ce23..f95aa8167c7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerFallbackReaderFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerFallbackReaderFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2010 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 @@ -32,6 +32,7 @@ import org.eclipse.core.runtime.CoreException; * * @since 4.0 */ +@Deprecated public class StandaloneIndexerFallbackReaderFactory extends AbstractCodeReaderFactory { public StandaloneIndexerFallbackReaderFactory() { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CodeReaderFactoryAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CodeReaderFactoryAdapter.java index 9a47d2cc5d0..39571347044 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CodeReaderFactoryAdapter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CodeReaderFactoryAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Wind River Systems, Inc. and others. + * Copyright (c) 2009, 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 @@ -18,6 +18,7 @@ import org.eclipse.cdt.internal.core.dom.AbstractCodeReaderFactory; import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContentProvider; import org.eclipse.core.runtime.CoreException; +@Deprecated public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory { /** @@ -43,19 +44,16 @@ public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory { fDelegate= fcp; } - @SuppressWarnings("deprecation") public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForInclusion(String path) { return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path)); } - @SuppressWarnings("deprecation") @Override public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForInclusion(IIndexFileLocation ifl, String astPath) throws CoreException, IOException { return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(ifl, astPath)); } - @SuppressWarnings("deprecation") public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForTranslationUnit(String path) { return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path)); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/FileContentProviderAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/FileContentProviderAdapter.java index 50d7e3affa3..33d65e001f9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/FileContentProviderAdapter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/FileContentProviderAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Wind River Systems, Inc. and others. + * Copyright (c) 2009, 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 @@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.core.parser; import java.io.IOException; import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.dom.ICodeReaderFactory; import org.eclipse.cdt.core.index.IIndexFileLocation; import org.eclipse.cdt.core.parser.FileContent; import org.eclipse.cdt.internal.core.dom.AbstractCodeReaderFactory; @@ -21,13 +22,14 @@ import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContent; import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContentProvider; import org.eclipse.core.runtime.CoreException; +@Deprecated public class FileContentProviderAdapter extends InternalFileContentProvider { /** * @deprecated avoid using the adapter, its for backwards compatibility, only. */ @Deprecated - public static InternalFileContentProvider adapt(org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator) { + public static InternalFileContentProvider adapt(ICodeReaderFactory fileCreator) { if (fileCreator == null) return null; @@ -54,13 +56,11 @@ public class FileContentProviderAdapter extends InternalFileContentProvider { return fDelegate; } - @SuppressWarnings("deprecation") @Override public InternalFileContent getContentForInclusion(String path) { return (InternalFileContent) FileContent.adapt(fDelegate.createCodeReaderForInclusion(path)); } - @SuppressWarnings("deprecation") @Override public InternalFileContent getContentForInclusion(IIndexFileLocation ifl, String astPath) { try { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java index 0b0438475c3..cb589465b3b 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.PlatformObject; public abstract class AbstractCExtension extends PlatformObject implements ICExtension { private IProject fProject; + @Deprecated private ICExtensionReference extensionRef; private ICConfigExtensionReference fCfgExtensionRef; @@ -74,6 +75,7 @@ public abstract class AbstractCExtension extends PlatformObject implements ICExt /** * @noreference This method is not intended to be referenced by clients. */ + @Deprecated public void setExtensionReference(ICExtensionReference extReference) { extensionRef = extReference; } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/IASTServiceProvider.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/IASTServiceProvider.java index 9372c4636f1..9ea1570a3c4 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/IASTServiceProvider.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/IASTServiceProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2010 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 @@ -12,6 +12,8 @@ package org.eclipse.cdt.core.dom; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.model.ILanguage; +import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IStorage; @@ -24,7 +26,9 @@ import org.eclipse.core.resources.IStorage; * @author jcamelon * @noextend This interface is not intended to be extended by clients. * @noimplement This interface is not intended to be implemented by clients. + * @deprecated Use methods provided by {@link ITranslationUnit} or {@link ILanguage}. */ +@Deprecated public interface IASTServiceProvider { /** diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java index 6455cab0df3..5a16eb8821d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2010 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 @@ -40,6 +40,7 @@ import org.eclipse.core.runtime.jobs.Job; * @noextend This class is not intended to be subclassed by clients. * @noinstantiate This class is not intended to be instantiated by clients. */ +@Deprecated public class CodeReaderCache implements ICodeReaderCache { /** * The string used to identify this CodeReaderCache. Mainly used for preferences. diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java index 659d570a352..57d7c80f3e3 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2009 IBM Corporation and others. + * Copyright (c) 2002, 2010 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 @@ -62,6 +62,7 @@ public class ParserUtil return null; } + @Deprecated public static CodeReader createReader(String path, Iterator workingCopies) { // check to see if the file which this path points to points to an // IResource in the workspace diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/AbstractCodeReaderFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/AbstractCodeReaderFactory.java index 2842b9e065d..7b2c900a45f 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/AbstractCodeReaderFactory.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/AbstractCodeReaderFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others. + * Copyright (c) 2008, 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 @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.IAdaptable; /** * Base implementation for all code reader factories. */ +@Deprecated public abstract class AbstractCodeReaderFactory implements ICodeReaderFactory, IAdaptable { private final IIncludeFileResolutionHeuristics fHeuristics; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/NullCodeReaderFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/NullCodeReaderFactory.java index 47453aafb2b..4a488aa8dcb 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/NullCodeReaderFactory.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/NullCodeReaderFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 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 @@ -19,6 +19,7 @@ import org.eclipse.cdt.core.parser.ICodeReaderCache; * * @since 4.0 */ +@Deprecated public class NullCodeReaderFactory extends AbstractCodeReaderFactory { private static final char[] EMPTY_CHARS = new char[0]; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/PartialWorkingCopyCodeReaderFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/PartialWorkingCopyCodeReaderFactory.java index 289c4265758..ea34d4d7d5d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/PartialWorkingCopyCodeReaderFactory.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/PartialWorkingCopyCodeReaderFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2010 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 @@ -28,6 +28,7 @@ import org.eclipse.core.runtime.CoreException; /** * @author jcamelon */ +@Deprecated public class PartialWorkingCopyCodeReaderFactory extends AbstractCodeReaderFactory { private final IWorkingCopyProvider provider; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/SavedCodeReaderFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/SavedCodeReaderFactory.java index fa82038dca9..0f43aaabee2 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/SavedCodeReaderFactory.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/SavedCodeReaderFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2010 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 @@ -25,6 +25,7 @@ import org.eclipse.core.runtime.Preferences; /** * @author jcamelon */ +@Deprecated public class SavedCodeReaderFactory extends AbstractCodeReaderFactory { private static ICodeReaderCache cache; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java index 0f28e9658ab..1620597a46d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2010 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 @@ -18,6 +18,7 @@ import org.eclipse.cdt.core.parser.IScanner; /** * @author jcamelon */ +@Deprecated public class WorkingCopyCodeReaderFactory extends PartialWorkingCopyCodeReaderFactory { /**