1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Compiler warnings.

This commit is contained in:
Markus Schorn 2010-02-18 08:16:21 +00:00
parent 43cb130a27
commit 88ba647612
23 changed files with 115 additions and 99 deletions

View file

@ -11,7 +11,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.model; 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.IASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.index.IIndex; 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.IScannerInfo;
import org.eclipse.cdt.core.parser.IncludeFileContentProvider; import org.eclipse.cdt.core.parser.IncludeFileContentProvider;
import org.eclipse.cdt.internal.core.parser.CodeReaderAdapter; 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.CoreException;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
@ -47,7 +45,7 @@ public abstract class AbstractLanguage extends PlatformObject implements ILangua
@Deprecated @Deprecated
public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, public IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, 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 { throws CoreException {
// For backwards compatibility, should be overridden. // For backwards compatibility, should be overridden.
return getASTTranslationUnit(reader, scanInfo, fileCreator, index, log); 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) IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log)
throws CoreException { throws CoreException {
// For backwards compatibility, should be overridden. // For backwards compatibility, should be overridden.
return getASTTranslationUnit(CodeReaderAdapter.adapt(content), scanInfo, CodeReaderFactoryAdapter return getASTTranslationUnit(CodeReaderAdapter.adapt(content), scanInfo,
.adapt(fileCreator), index, options, log); 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) IncludeFileContentProvider fileCreator, IIndex index, IParserLogService log, int offset)
throws CoreException { throws CoreException {
// For backwards compatibility, should be overridden. // For backwards compatibility, should be overridden.
return getCompletionNode(CodeReaderAdapter.adapt(reader), scanInfo, CodeReaderFactoryAdapter return getCompletionNode(CodeReaderAdapter.adapt(reader), scanInfo,
.adapt(fileCreator), index, log, offset); org.eclipse.cdt.internal.core.parser.CodeReaderFactoryAdapter.adapt(fileCreator), index, log,
offset);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -13,13 +13,11 @@ package org.eclipse.cdt.core.model;
import java.util.Set; import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin; 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.ILinkage;
import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.index.IIndex; 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.IParserLogService;
import org.eclipse.cdt.core.parser.IScannerInfo; import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.KeywordSetKey; 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) * @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, @Deprecated
ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) throws CoreException { 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; 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) * @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, @Deprecated
ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset) throws CoreException { 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; return null;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,7 +12,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.model; 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.ILinkage;
import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTCompletionNode; import org.eclipse.cdt.core.dom.ast.IASTCompletionNode;
@ -154,22 +153,24 @@ public interface ILanguage extends IAdaptable {
*/ */
@Deprecated @Deprecated
IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index,
throws CoreException; IParserLogService log) throws CoreException;
/** /**
* @deprecated replaced by {@link #getASTTranslationUnit(FileContent, IScannerInfo, * @deprecated replaced by {@link #getASTTranslationUnit(FileContent, IScannerInfo,
* IncludeFileContentProvider, IIndex, int, IParserLogService)} * IncludeFileContentProvider, IIndex, int, IParserLogService)}
*/ */
@Deprecated @Deprecated
IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, int options, IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index,
IParserLogService log) throws CoreException; int options, IParserLogService log) throws CoreException;
/** /**
* @deprecated replaced by {@link #getCompletionNode(FileContent, IScannerInfo, * @deprecated replaced by {@link #getCompletionNode(FileContent, IScannerInfo,
* IncludeFileContentProvider, IIndex, IParserLogService, int)}. * IncludeFileContentProvider, IIndex, IParserLogService, int)}.
*/ */
@Deprecated @Deprecated
IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader, IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader,
IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, IIndex index,
int offset) throws CoreException; IParserLogService log, int offset) throws CoreException;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -214,6 +214,7 @@ public class PathEntryTranslator {
}; };
// private static final int INEXISTENT_INDEX = -1; // private static final int INEXISTENT_INDEX = -1;
@SuppressWarnings("unchecked")
private Map<String, IPathEntry>[] fEntryStorage = new Map[STORAGE_SIZE]; private Map<String, IPathEntry>[] fEntryStorage = new Map[STORAGE_SIZE];
private int kindToIndex(int kind){ private int kindToIndex(int kind){
@ -1752,13 +1753,10 @@ public class PathEntryTranslator {
private ResourceInfo[] performTranslation(IPath basePath, ResourceInfo[] baseInfos, String seg){ private ResourceInfo[] performTranslation(IPath basePath, ResourceInfo[] baseInfos, String seg){
IPath filterFullPath = basePath.append(seg); IPath filterFullPath = basePath.append(seg);
boolean needsParsing = hasSpecChars(seg); boolean needsParsing = hasSpecChars(seg);
ResourceInfo baseInfo;
List<ResourceInfo> list = new ArrayList<ResourceInfo>(); List<ResourceInfo> list = new ArrayList<ResourceInfo>();
char[] segChars = seg.toCharArray(); char[] segChars = seg.toCharArray();
IResource baseRc; for (ResourceInfo baseInfo : baseInfos) {
for(int i = 0; i < baseInfos.length; i++){ IResource baseRc = baseInfo.fRc;
baseInfo = baseInfos[i];
baseRc = baseInfo.fRc;
if(baseRc.getType() == IResource.FILE){ if(baseRc.getType() == IResource.FILE){
continue; continue;
} else { } else {
@ -1773,8 +1771,8 @@ public class PathEntryTranslator {
IResource children[] = baseCr.members(); IResource children[] = baseCr.members();
ResourceInfo rcInfo; ResourceInfo rcInfo;
for (IResource child : children) { for (IResource child : children) {
if(CoreModelUtil.match(segChars, children[i].getName().toCharArray(), true)){ if(CoreModelUtil.match(segChars, child.getName().toCharArray(), true)){
rcInfo = new ResourceInfo(children[i], true); rcInfo = new ResourceInfo(child, true);
addRcInfoToMap(rcInfo); addRcInfoToMap(rcInfo);
list.add(rcInfo); list.add(rcInfo);
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -82,27 +82,29 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
boolean removed = false; boolean removed = false;
switch (delta.getKind()) { switch (delta.getKind()) {
case IResourceDelta.REMOVED : case IResourceDelta.REMOVED:
removed = true; removed = true;
case IResourceDelta.CHANGED : //$FALL-THROUGH$
case IResourceDelta.CHANGED:
int flags = delta.getFlags(); int flags = delta.getFlags();
if ((flags & IResourceDelta.MOVED_TO) != 0) { if ((flags & IResourceDelta.MOVED_TO) != 0) {
IPath path = delta.getMovedToPath(); IPath path = delta.getMovedToPath();
if(path != null){ if (path != null) {
IResource toRc = getResource(path, dResource); IResource toRc = getResource(path, dResource);
resume = checkInitHandleResourceMove(dResource, toRc); resume = checkInitHandleResourceMove(dResource, toRc);
} }
break; break;
} else if((flags & IResourceDelta.MOVED_FROM) != 0){ } else if ((flags & IResourceDelta.MOVED_FROM) != 0) {
IPath path = delta.getMovedFromPath(); IPath path = delta.getMovedFromPath();
if(path != null){ if (path != null) {
IResource fromRc = getResource(path, dResource); IResource fromRc = getResource(path, dResource);
resume = checkInitHandleResourceMove(fromRc, dResource); resume = checkInitHandleResourceMove(fromRc, dResource);
} }
break; break;
} else if (removed){ } else if (removed) {
resume = fHandler.handleResourceRemove(dResource); resume = fHandler.handleResourceRemove(dResource);
} }
break;
default: default:
break; break;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -158,6 +158,7 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
switch(event.getEventType()){ switch(event.getEventType()){
case CProjectDescriptionEvent.LOADED: case CProjectDescriptionEvent.LOADED:
force = true; force = true;
//$FALL-THROUGH$
case CProjectDescriptionEvent.APPLIED: case CProjectDescriptionEvent.APPLIED:
ICProjectDescription des = event.getNewCProjectDescription(); ICProjectDescription des = event.getNewCProjectDescription();
if(des != null){ if(des != null){

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -18,11 +18,13 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.Map.Entry;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICExclusionPatternPathEntry; import org.eclipse.cdt.core.settings.model.ICExclusionPatternPathEntry;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; 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.ICResourceDescription;
import org.eclipse.cdt.core.settings.model.ICSourceEntry; import org.eclipse.cdt.core.settings.model.ICSourceEntry;
import org.eclipse.cdt.core.settings.model.WriteAccessException; import org.eclipse.cdt.core.settings.model.WriteAccessException;
@ -96,8 +98,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
ICProjectDescription des = getProjectDescription(toProject, true); ICProjectDescription des = getProjectDescription(toProject, true);
if(des != null){ if(des != null){
ICConfigurationDescription cfgDess[] = des.getConfigurations(); ICConfigurationDescription cfgDess[] = des.getConfigurations();
for(int i = 0; i < cfgDess.length; i++){ for (ICConfigurationDescription cfg : cfgDess) {
ICConfigurationDescription cfg = cfgDess[i];
ICExclusionPatternPathEntry entries[] = cfg.getSourceEntries(); ICExclusionPatternPathEntry entries[] = cfg.getSourceEntries();
entries = checkMove(fromFullPath, toFullPath, entries); entries = checkMove(fromFullPath, toFullPath, entries);
if(entries != null){ if(entries != null){
@ -134,8 +135,8 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
ICProjectDescription des = getProjectDescription(toProject, true); ICProjectDescription des = getProjectDescription(toProject, true);
if(des != null){ if(des != null){
ICConfigurationDescription cfgDess[] = des.getConfigurations(); ICConfigurationDescription cfgDess[] = des.getConfigurations();
for(int i = 0; i < cfgDess.length; i++){ for (ICConfigurationDescription cfgDes : cfgDess) {
ICResourceDescription rcDescription = cfgDess[i].getResourceDescription(fromRcProjPath, true); ICResourceDescription rcDescription = cfgDes.getResourceDescription(fromRcProjPath, true);
if(rcDescription != null){ if(rcDescription != null){
try { try {
rcDescription.setPath(toRcProjPath); rcDescription.setPath(toRcProjPath);
@ -156,9 +157,9 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
IProject project = rc.getProject(); IProject project = rc.getProject();
ICProjectDescription des = fProjDesMap.get(project); ICProjectDescription des = fProjDesMap.get(project);
if(des == null && !fProjDesMap.containsKey(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.INTERNAL_GET_IGNORE_CLOSE;
flags |= CProjectDescriptionManager.GET_WRITABLE; flags |= ICProjectDescriptionManager.GET_WRITABLE;
des = fMngr.getProjectDescription(project, flags); des = fMngr.getProjectDescription(project, flags);
if(des != null) if(des != null)
fProjDesMap.put(project, des); fProjDesMap.put(project, des);
@ -166,15 +167,15 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
return des; return des;
} }
private void setProjectDescription(IProject project, ICProjectDescription des){ // private void setProjectDescription(IProject project, ICProjectDescription des){
fProjDesMap.put(project, des); // fProjDesMap.put(project, des);
} // }
private List<ICExclusionPatternPathEntry> checkRemove(IPath rcFullPath, ICExclusionPatternPathEntry[] entries){ private List<ICExclusionPatternPathEntry> checkRemove(IPath rcFullPath, ICExclusionPatternPathEntry[] entries){
List<ICExclusionPatternPathEntry> updatedList = null; List<ICExclusionPatternPathEntry> updatedList = null;
int num = 0; int num = 0;
for(int k = 0; k < entries.length; k++){ for (ICExclusionPatternPathEntry entrie : entries) {
if(entries[k].getFullPath().equals(rcFullPath)){ if(entrie.getFullPath().equals(rcFullPath)){
if(updatedList == null){ if(updatedList == null){
updatedList = new ArrayList<ICExclusionPatternPathEntry>(Arrays.asList(entries)); updatedList = new ArrayList<ICExclusionPatternPathEntry>(Arrays.asList(entries));
} }
@ -202,8 +203,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
if(des != null){ if(des != null){
IPath rcFullPath = rc.getFullPath(); IPath rcFullPath = rc.getFullPath();
ICConfigurationDescription cfgDess[] = des.getConfigurations(); ICConfigurationDescription cfgDess[] = des.getConfigurations();
for(int i = 0; i < cfgDess.length; i++){ for (ICConfigurationDescription cfg : cfgDess) {
ICConfigurationDescription cfg = cfgDess[i];
ICExclusionPatternPathEntry[] entries = cfg.getSourceEntries(); ICExclusionPatternPathEntry[] entries = cfg.getSourceEntries();
List<ICExclusionPatternPathEntry> updatedList = checkRemove(rcFullPath, entries); List<ICExclusionPatternPathEntry> updatedList = checkRemove(rcFullPath, entries);
@ -235,11 +235,11 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
if(des != null){ if(des != null){
IPath rcProjPath = rc.getProjectRelativePath(); IPath rcProjPath = rc.getProjectRelativePath();
ICConfigurationDescription cfgDess[] = des.getConfigurations(); ICConfigurationDescription cfgDess[] = des.getConfigurations();
for(int i = 0; i < cfgDess.length; i++){ for (ICConfigurationDescription cfgDes : cfgDess) {
ICResourceDescription rcDescription = cfgDess[i].getResourceDescription(rcProjPath, true); ICResourceDescription rcDescription = cfgDes.getResourceDescription(rcProjPath, true);
if(rcDescription != null){ if(rcDescription != null){
try { try {
cfgDess[i].removeResourceDescription(rcDescription); cfgDes.removeResourceDescription(rcDescription);
} catch (WriteAccessException e) { } catch (WriteAccessException e) {
CCorePlugin.log(e); CCorePlugin.log(e);
} catch (CoreException e) { } catch (CoreException e) {
@ -271,8 +271,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
CProjectDescriptionManager.runWspModification(new IWorkspaceRunnable(){ CProjectDescriptionManager.runWspModification(new IWorkspaceRunnable(){
public void run(IProgressMonitor monitor) throws CoreException { public void run(IProgressMonitor monitor) throws CoreException {
for(Iterator<Map.Entry<IProject, ICProjectDescription>> iter = fProjDesMap.entrySet().iterator(); iter.hasNext();){ for (Entry<IProject, ICProjectDescription> entry : fProjDesMap.entrySet()) {
Map.Entry<IProject, ICProjectDescription> entry = iter.next();
IProject project = entry.getKey(); IProject project = entry.getKey();
if(!project.isOpen()) if(!project.isOpen())
continue; continue;
@ -337,8 +336,8 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
IResourceDelta delta = event.getDelta(); IResourceDelta delta = event.getDelta();
if(delta != null){ if(delta != null){
IResourceDelta projs[] = delta.getAffectedChildren(); IResourceDelta projs[] = delta.getAffectedChildren();
for(int i = 0; i < projs.length; i++){ for (IResourceDelta proj : projs) {
IResourceDelta projDelta = projs[i]; IResourceDelta projDelta = proj;
if(!shouldVisit((IProject)projDelta.getResource())) if(!shouldVisit((IProject)projDelta.getResource()))
continue; continue;
@ -346,8 +345,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
continue; continue;
IResourceDelta children[] = projDelta.getAffectedChildren(); IResourceDelta children[] = projDelta.getAffectedChildren();
for(int k = 0; k < children.length; k++){ for (IResourceDelta child : children) {
IResourceDelta child = children[k];
IResource rc = child.getResource(); IResource rc = child.getResource();
if(rc.getType() != IResource.FILE) if(rc.getType() != IResource.FILE)
continue; continue;

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,7 +11,6 @@
package org.eclipse.cdt.core.parser; package org.eclipse.cdt.core.parser;
import org.eclipse.cdt.internal.core.parser.EmptyFilesProvider; import org.eclipse.cdt.internal.core.parser.EmptyFilesProvider;
import org.eclipse.cdt.internal.core.parser.FileContentProviderAdapter;
import org.eclipse.cdt.internal.core.parser.SavedFilesProvider; import org.eclipse.cdt.internal.core.parser.SavedFilesProvider;
@ -44,6 +43,6 @@ public abstract class IncludeFileContentProvider {
*/ */
@Deprecated @Deprecated
public static IncludeFileContentProvider adapt(org.eclipse.cdt.core.dom.ICodeReaderFactory factory) { 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);
} }
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -35,6 +35,7 @@ public class StandaloneFastIndexerTask extends StandaloneIndexerTask {
super(indexer, added, changed, removed, true); super(indexer, added, changed, removed, true);
} }
@SuppressWarnings("deprecation")
@Override @Override
protected IncludeFileContentProvider createReaderFactory() { protected IncludeFileContentProvider createReaderFactory() {
return IncludeFileContentProvider.adapt(new StandaloneIndexerFallbackReaderFactory()); return IncludeFileContentProvider.adapt(new StandaloneIndexerFallbackReaderFactory());

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -40,6 +40,7 @@ import org.eclipse.core.runtime.CoreException;
* *
* @since 4.0 * @since 4.0
*/ */
@SuppressWarnings("deprecation")
public class StandaloneFullIndexer extends StandaloneIndexer{ public class StandaloneFullIndexer extends StandaloneIndexer{
private AbstractCodeReaderFactory fCodeReaderFactory; private AbstractCodeReaderFactory fCodeReaderFactory;

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -36,6 +36,7 @@ public class StandaloneFullIndexerTask extends StandaloneIndexerTask {
super(indexer, added, changed, removed, false); super(indexer, added, changed, removed, false);
} }
@SuppressWarnings("deprecation")
@Override @Override
protected IncludeFileContentProvider createReaderFactory() { protected IncludeFileContentProvider createReaderFactory() {
return IncludeFileContentProvider.adapt(((StandaloneFullIndexer)fIndexer).getCodeReaderFactory()); return IncludeFileContentProvider.adapt(((StandaloneFullIndexer)fIndexer).getCodeReaderFactory());

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -32,6 +32,7 @@ import org.eclipse.core.runtime.CoreException;
* *
* @since 4.0 * @since 4.0
*/ */
@Deprecated
public class StandaloneIndexerFallbackReaderFactory extends AbstractCodeReaderFactory { public class StandaloneIndexerFallbackReaderFactory extends AbstractCodeReaderFactory {
public StandaloneIndexerFallbackReaderFactory() { public StandaloneIndexerFallbackReaderFactory() {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.cdt.internal.core.parser.scanner.InternalFileContentProvider;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@Deprecated
public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory { public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory {
/** /**
@ -43,19 +44,16 @@ public class CodeReaderFactoryAdapter extends AbstractCodeReaderFactory {
fDelegate= fcp; fDelegate= fcp;
} }
@SuppressWarnings("deprecation")
public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForInclusion(String path) { public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForInclusion(String path) {
return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path)); return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path));
} }
@SuppressWarnings("deprecation")
@Override @Override
public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForInclusion(IIndexFileLocation ifl, String astPath) public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForInclusion(IIndexFileLocation ifl, String astPath)
throws CoreException, IOException { throws CoreException, IOException {
return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(ifl, astPath)); return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(ifl, astPath));
} }
@SuppressWarnings("deprecation")
public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForTranslationUnit(String path) { public org.eclipse.cdt.core.parser.CodeReader createCodeReaderForTranslationUnit(String path) {
return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path)); return CodeReaderAdapter.adapt(fDelegate.getContentForInclusion(path));
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.core.parser;
import java.io.IOException; import java.io.IOException;
import org.eclipse.cdt.core.CCorePlugin; 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.index.IIndexFileLocation;
import org.eclipse.cdt.core.parser.FileContent; import org.eclipse.cdt.core.parser.FileContent;
import org.eclipse.cdt.internal.core.dom.AbstractCodeReaderFactory; 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.cdt.internal.core.parser.scanner.InternalFileContentProvider;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@Deprecated
public class FileContentProviderAdapter extends InternalFileContentProvider { public class FileContentProviderAdapter extends InternalFileContentProvider {
/** /**
* @deprecated avoid using the adapter, its for backwards compatibility, only. * @deprecated avoid using the adapter, its for backwards compatibility, only.
*/ */
@Deprecated @Deprecated
public static InternalFileContentProvider adapt(org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator) { public static InternalFileContentProvider adapt(ICodeReaderFactory fileCreator) {
if (fileCreator == null) if (fileCreator == null)
return null; return null;
@ -54,13 +56,11 @@ public class FileContentProviderAdapter extends InternalFileContentProvider {
return fDelegate; return fDelegate;
} }
@SuppressWarnings("deprecation")
@Override @Override
public InternalFileContent getContentForInclusion(String path) { public InternalFileContent getContentForInclusion(String path) {
return (InternalFileContent) FileContent.adapt(fDelegate.createCodeReaderForInclusion(path)); return (InternalFileContent) FileContent.adapt(fDelegate.createCodeReaderForInclusion(path));
} }
@SuppressWarnings("deprecation")
@Override @Override
public InternalFileContent getContentForInclusion(IIndexFileLocation ifl, String astPath) { public InternalFileContent getContentForInclusion(IIndexFileLocation ifl, String astPath) {
try { try {

View file

@ -17,6 +17,7 @@ import org.eclipse.core.runtime.PlatformObject;
public abstract class AbstractCExtension extends PlatformObject implements ICExtension { public abstract class AbstractCExtension extends PlatformObject implements ICExtension {
private IProject fProject; private IProject fProject;
@Deprecated
private ICExtensionReference extensionRef; private ICExtensionReference extensionRef;
private ICConfigExtensionReference fCfgExtensionRef; 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. * @noreference This method is not intended to be referenced by clients.
*/ */
@Deprecated
public void setExtensionReference(ICExtensionReference extReference) { public void setExtensionReference(ICExtensionReference extReference) {
extensionRef = extReference; extensionRef = extReference;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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.IASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; 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.IFile;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IStorage; import org.eclipse.core.resources.IStorage;
@ -24,7 +26,9 @@ import org.eclipse.core.resources.IStorage;
* @author jcamelon * @author jcamelon
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented 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 { public interface IASTServiceProvider {
/** /**

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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. * @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients. * @noinstantiate This class is not intended to be instantiated by clients.
*/ */
@Deprecated
public class CodeReaderCache implements ICodeReaderCache { public class CodeReaderCache implements ICodeReaderCache {
/** /**
* The string used to identify this CodeReaderCache. Mainly used for preferences. * The string used to identify this CodeReaderCache. Mainly used for preferences.

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -62,6 +62,7 @@ public class ParserUtil
return null; return null;
} }
@Deprecated
public static CodeReader createReader(String path, Iterator<IWorkingCopy> workingCopies) { public static CodeReader createReader(String path, Iterator<IWorkingCopy> workingCopies) {
// check to see if the file which this path points to points to an // check to see if the file which this path points to points to an
// IResource in the workspace // IResource in the workspace

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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. * Base implementation for all code reader factories.
*/ */
@Deprecated
public abstract class AbstractCodeReaderFactory implements ICodeReaderFactory, IAdaptable { public abstract class AbstractCodeReaderFactory implements ICodeReaderFactory, IAdaptable {
private final IIncludeFileResolutionHeuristics fHeuristics; private final IIncludeFileResolutionHeuristics fHeuristics;

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -19,6 +19,7 @@ import org.eclipse.cdt.core.parser.ICodeReaderCache;
* *
* @since 4.0 * @since 4.0
*/ */
@Deprecated
public class NullCodeReaderFactory extends AbstractCodeReaderFactory { public class NullCodeReaderFactory extends AbstractCodeReaderFactory {
private static final char[] EMPTY_CHARS = new char[0]; private static final char[] EMPTY_CHARS = new char[0];

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -28,6 +28,7 @@ import org.eclipse.core.runtime.CoreException;
/** /**
* @author jcamelon * @author jcamelon
*/ */
@Deprecated
public class PartialWorkingCopyCodeReaderFactory extends AbstractCodeReaderFactory { public class PartialWorkingCopyCodeReaderFactory extends AbstractCodeReaderFactory {
private final IWorkingCopyProvider provider; private final IWorkingCopyProvider provider;

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -25,6 +25,7 @@ import org.eclipse.core.runtime.Preferences;
/** /**
* @author jcamelon * @author jcamelon
*/ */
@Deprecated
public class SavedCodeReaderFactory extends AbstractCodeReaderFactory { public class SavedCodeReaderFactory extends AbstractCodeReaderFactory {
private static ICodeReaderCache cache; private static ICodeReaderCache cache;

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.parser.IScanner;
/** /**
* @author jcamelon * @author jcamelon
*/ */
@Deprecated
public class WorkingCopyCodeReaderFactory extends PartialWorkingCopyCodeReaderFactory { public class WorkingCopyCodeReaderFactory extends PartialWorkingCopyCodeReaderFactory {
/** /**