From e560beb08a64b6f37415998585ed3622bdffa9b5 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 4 Jan 2012 12:14:50 +0100 Subject: [PATCH 1/5] Fixes a few JUnit test failures. --- .../parser/tests/ast2/SemanticsTests.java | 12 ++--- .../tests/IndexCPPTemplateResolutionTest.java | 4 +- .../eclipse/cdt/core/index/IIndexFileSet.java | 10 +++- .../internal/core/dom/parser/ASTInternal.java | 15 +++++- .../internal/core/index/IIndexFragment.java | 7 +-- .../cdt/internal/core/index/IndexFileSet.java | 54 +++++++++++++++---- .../eclipse/cdt/internal/core/pdom/PDOM.java | 14 +++-- .../internal/core/pdom/dom/PDOMLinkage.java | 12 +++-- .../core/pdom/dom/c/PDOMCLinkage.java | 14 +++-- .../core/pdom/dom/cpp/PDOMCPPLinkage.java | 14 +++-- 10 files changed, 115 insertions(+), 41 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/SemanticsTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/SemanticsTests.java index e1a07d8dcd8..760aedb62bc 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/SemanticsTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/SemanticsTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 Symbian Software Systems and others. + * Copyright (c) 2008, 2012 Symbian 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 @@ -86,7 +86,8 @@ public class SemanticsTests extends AST2BaseTest { // operator A(); // conversion // operator B(); // conversion // }; - public void testGetDeclaredConversionOperators() throws Exception { + public void testConversionOperators() throws Exception { + // Test getDeclaredConversionOperators() BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true); ICPPClassType c= ba.assertNonProblem("X {", 1, ICPPClassType.class); ICPPMethod[] cops= SemanticUtil.getDeclaredConversionOperators(c); @@ -96,11 +97,8 @@ public class SemanticsTests extends AST2BaseTest { Set expected= new HashSet(); expected.add("operator A"); expected.add("operator B"); assertEquals(expected, actual); - } - - public void testIsConversionOperator() throws Exception { - BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true); - ICPPClassType c= ba.assertNonProblem("X {", 1, ICPPClassType.class); + + // Test isConversionOperator() ICPPMethod[] dms= c.getDeclaredMethods(); assertEquals(48, dms.length); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java index b837c87a7a6..f999d7a8909 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 Symbian Software Systems and others. + * Copyright (c) 2007, 2012 Symbian 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 @@ -283,9 +283,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa assertInstance(b0, ICPPMethod.class); assertEquals(1, getIndex().findNames(b0, IIndex.FIND_REFERENCES).length); IParameter[] parameters = ((ICPPMethod) b0).getParameters(); - System.out.println(String.valueOf(parameters)); IFunctionType type = ((ICPPMethod) b0).getType(); - System.out.println(String.valueOf(type)); } // template diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFileSet.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFileSet.java index a30d8b1f34f..61256b0efaa 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFileSet.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFileSet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 Wind River Systems, Inc. and others. + * Copyright (c) 2008, 2012 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 @@ -12,6 +12,7 @@ package org.eclipse.cdt.core.index; import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.internal.core.index.IIndexFragment; import org.eclipse.cdt.internal.core.index.IndexFileSet; import org.eclipse.core.runtime.CoreException; @@ -60,4 +61,11 @@ public interface IIndexFileSet { * @noreference This method is not intended to be referenced by clients. */ void remove(IIndexFile indexFile); + + /** + * Checks whether the given binding has a non-local declaration in + * another index fragment. + * @noreference This method is not intended to be referenced by clients. + */ + boolean containsNonLocalDeclaration(IBinding binding, IIndexFragment ignore); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java index 866a55bf964..e2087d27d62 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2012 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.dom.parser; import org.eclipse.cdt.core.dom.ast.IASTFileLocation; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTNode; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IFunction; import org.eclipse.cdt.core.dom.ast.IScope; @@ -22,6 +23,7 @@ import org.eclipse.cdt.internal.core.dom.parser.c.ICInternalBinding; import org.eclipse.cdt.internal.core.dom.parser.c.ICInternalFunction; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalFunction; +import org.eclipse.cdt.internal.core.index.IIndexFragment; import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; import org.eclipse.core.runtime.CoreException; @@ -72,7 +74,7 @@ public class ASTInternal { } } - public static IASTNode getDeclaredInSourceFileOnly(IBinding binding, boolean requireDefinition, PDOMBinding nonLocal) { + public static IASTNode getDeclaredInSourceFileOnly(IIndexFragment forFragment, IBinding binding, boolean requireDefinition, PDOMBinding nonLocal) { IASTNode[] decls; IASTNode def; if (binding instanceof ICPPInternalBinding) { @@ -105,6 +107,9 @@ public class ASTInternal { } } } + if (result == null) + return null; + if (requireDefinition && nonLocal != null) { try { if (nonLocal.hasDeclaration()) @@ -112,6 +117,12 @@ public class ASTInternal { } catch (CoreException e) { } } + + IASTTranslationUnit tu= result.getTranslationUnit(); + if (tu != null) { + if (tu.getIndexFileSet().containsNonLocalDeclaration(binding, forFragment)) + return null; + } return result; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragment.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragment.java index 3675ce5ed57..bc7558d648a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragment.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragment.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2012 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 @@ -58,6 +58,7 @@ public interface IIndexFragment { */ final int FIND_ALL_OCCURRENCES = IIndex.FIND_ALL_OCCURRENCES; + final int FIND_NON_LOCAL_ONLY= 0x10000; /** * Property key for the fragment ID. The fragment ID should uniquely identify the fragments * usage within a logical index. @@ -223,8 +224,8 @@ public interface IIndexFragment { * Searches for all names that resolve to the given binding. You can limit the result to * references, declarations or definitions, or a combination of those. * @param binding a binding for which names are searched for - * @param flags a combination of {@link #FIND_DECLARATIONS}, {@link #FIND_DEFINITIONS} and - * {@link #FIND_REFERENCES} + * @param flags a combination of {@link #FIND_DECLARATIONS}, {@link #FIND_DEFINITIONS}, + * {@link #FIND_REFERENCES} and {@link #FIND_NON_LOCAL_ONLY} * @return an array of names * @throws CoreException */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileSet.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileSet.java index 395eefc0664..854a486cc67 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileSet.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFileSet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 Wind River Systems, Inc. and others. + * Copyright (c) 2008, 2012 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 @@ -29,6 +29,7 @@ public class IndexFileSet implements IIndexFileSet { public IndexFileSet() { } + @Override public void add(IIndexFile indexFile) { final IIndexFragmentFile fragFile = (IIndexFragmentFile) indexFile; final IIndexFragment frag= fragFile.getIndexFragment(); @@ -40,6 +41,7 @@ public class IndexFileSet implements IIndexFileSet { subSet.add(fragFile); } + @Override public void remove(IIndexFile indexFile) { final IIndexFragmentFile fragFile = (IIndexFragmentFile) indexFile; final IIndexFragment frag= fragFile.getIndexFragment(); @@ -49,21 +51,16 @@ public class IndexFileSet implements IIndexFileSet { } } + @Override public boolean containsDeclaration(IIndexBinding binding) { - return containsDeclaration(binding, false); - } - - boolean containsDeclaration(IIndexBinding binding, boolean inverse) { for (Map.Entry entry : fSubSets.entrySet()) { try { IIndexFragmentName[] names = entry.getKey().findNames(binding, IIndexFragment.FIND_DECLARATIONS_DEFINITIONS); for (IIndexFragmentName name : names) { try { - final boolean foundDecl = entry.getValue().contains((IIndexFragmentFile) name.getFile()); - if (foundDecl != inverse) { + if (entry.getValue().contains((IIndexFragmentFile) name.getFile())) return true; - } } catch (CoreException e) { CCorePlugin.log(e); } @@ -75,6 +72,33 @@ public class IndexFileSet implements IIndexFileSet { return false; } + @Override + public boolean containsNonLocalDeclaration(IBinding binding, IIndexFragment ignore) { + for (Map.Entry entry : fSubSets.entrySet()) { + try { + final IIndexFragment fragment = entry.getKey(); + final IIndexFragmentFileSet subset = entry.getValue(); + if (fragment != ignore) { + IIndexFragmentName[] names = + fragment.findNames(binding, IIndexFragment.FIND_DECLARATIONS_DEFINITIONS | IIndexFragment.FIND_NON_LOCAL_ONLY); + for (IIndexFragmentName name : names) { + try { + if (subset.contains((IIndexFragmentFile) name.getFile())) { + return true; + } + } catch (CoreException e) { + CCorePlugin.log(e); + } + } + } + } catch (CoreException e) { + CCorePlugin.log(e); + } + } + return false; + } + + @Override public IBinding[] filterFileLocalBindings(IBinding[] bindings) { return filterFileLocalBindings(bindings, false); } @@ -131,6 +155,7 @@ public class IndexFileSet implements IIndexFileSet { return result; } + @Override public boolean contains(IIndexFile file) throws CoreException { return contains(file, false); } @@ -150,29 +175,40 @@ public class IndexFileSet implements IIndexFileSet { /* (non-Javadoc) * @see org.eclipse.cdt.core.index.IIndexFileSet#invert() */ + @Override public IIndexFileSet invert() { if (fInverse == null) { fInverse= new IIndexFileSet() { + @Override public IIndexFileSet invert() { return IndexFileSet.this; } + @Override public IBinding[] filterFileLocalBindings(IBinding[] bindings) { return IndexFileSet.this.filterFileLocalBindings(bindings, true); } + @Override public boolean containsDeclaration(IIndexBinding binding) { - return IndexFileSet.this.containsDeclaration(binding, true); + throw new UnsupportedOperationException(); + } + @Override + public boolean containsNonLocalDeclaration(IBinding binding, IIndexFragment ignore) { + throw new UnsupportedOperationException(); } + @Override public boolean contains(IIndexFile file) throws CoreException { return IndexFileSet.this.contains(file, true); } + @Override public void add(IIndexFile indexFile) { Assert.isLegal(false); } + @Override public void remove(IIndexFile indexFile) { Assert.isLegal(false); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java index decb09a25c5..4c9bf0ef0e5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 QNX Software Systems and others. + * Copyright (c) 2005, 2012 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 @@ -532,7 +532,7 @@ public class PDOM extends PlatformObject implements IPDOM { if (binding != null) { PDOMLinkage linkage= adaptLinkage(name.getLinkage()); if (linkage != null) { - return findBindingInLinkage(linkage, binding); + return findBindingInLinkage(linkage, binding, true); } } else if (name.getPropertyInParent() == IASTPreprocessorStatement.MACRO_NAME) { PDOMLinkage linkage= adaptLinkage(name.getLinkage()); @@ -993,6 +993,10 @@ public class PDOM extends PlatformObject implements IPDOM { @Override public IIndexFragmentBinding adaptBinding(IBinding binding) throws CoreException { + return adaptBinding(binding, true); + } + + private IIndexFragmentBinding adaptBinding(IBinding binding, boolean includeLocal) throws CoreException { if (binding == null) { return null; } @@ -1003,16 +1007,16 @@ public class PDOM extends PlatformObject implements IPDOM { PDOMLinkage linkage= adaptLinkage(binding.getLinkage()); if (linkage != null) { - return findBindingInLinkage(linkage, binding); + return findBindingInLinkage(linkage, binding, includeLocal); } return null; } - private IIndexFragmentBinding findBindingInLinkage(PDOMLinkage linkage, IBinding binding) throws CoreException { + private IIndexFragmentBinding findBindingInLinkage(PDOMLinkage linkage, IBinding binding, boolean includeLocal) throws CoreException { if (binding instanceof IMacroBinding || binding instanceof IIndexMacroContainer) { return linkage.findMacroContainer(binding.getNameCharArray()); } - return linkage.adaptBinding(binding); + return linkage.adaptBinding(binding, includeLocal); } public IIndexFragmentBinding findBinding(IIndexFragmentName indexName) throws CoreException { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java index 78d13b8b15b..812fbadd984 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 QNX Software Systems and others. + * Copyright (c) 2005, 2012 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 @@ -146,9 +146,11 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage getIndex().accept((IBTreeVisitor) visitor); } else { getIndex().accept(new IBTreeVisitor() { + @Override public int compare(long record) throws CoreException { return 0; } + @Override public boolean visit(long record) throws CoreException { PDOMNode node= getNode(record); if (node != null) { @@ -217,7 +219,11 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage return (PDOMBinding) fPDOM.getCachedResult(binding); } - public abstract PDOMBinding adaptBinding(IBinding binding) throws CoreException; + public final PDOMBinding adaptBinding(IBinding binding) throws CoreException { + return adaptBinding(binding, true); + } + + public abstract PDOMBinding adaptBinding(IBinding binding, boolean includeLocal) throws CoreException; public abstract PDOMBinding addBinding(IASTName name) throws CoreException; @@ -256,7 +262,7 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage } if (checkIfInSourceOnly) { - IASTNode node= ASTInternal.getDeclaredInSourceFileOnly(binding, requireDefinition, glob); + IASTNode node= ASTInternal.getDeclaredInSourceFileOnly(getPDOM(), binding, requireDefinition, glob); if (node != null) { return wpdom.getFileForASTNode(getLinkageID(), node); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java index 2a8e142b953..5bc96bd2275 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 QNX Software Systems and others. + * Copyright (c) 2006, 2012 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 @@ -62,10 +62,12 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants { return LINKAGE; } + @Override public String getLinkageName() { return C_LINKAGE_NAME; } + @Override public int getLinkageID() { return C_LINKAGE_ID; } @@ -226,8 +228,8 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants { } @Override - public final PDOMBinding adaptBinding(final IBinding inputBinding) throws CoreException { - return adaptBinding(null, inputBinding, FILE_LOCAL_REC_DUMMY); + public final PDOMBinding adaptBinding(final IBinding inputBinding, boolean includeLocal) throws CoreException { + return adaptBinding(null, inputBinding, includeLocal ? FILE_LOCAL_REC_DUMMY : null); } private final PDOMBinding adaptBinding(final PDOMNode parent, IBinding inputBinding, long[] localToFileHolder) throws CoreException { @@ -264,6 +266,9 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants { final int[] bindingTypes = new int[] {getBindingType(binding)}; final char[] nameChars = binding.getNameCharArray(); PDOMBinding nonLocal= FindBinding.findBinding(getIndex(), this, nameChars, bindingTypes, 0); + if (localToFileHolder == null) + return nonLocal; + long localToFileRec= getLocalToFileRec(parent, binding, nonLocal); if (localToFileRec == 0) return nonLocal; @@ -274,6 +279,9 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants { final int[] bindingTypes = new int[] {getBindingType(binding)}; final char[] nameChars = binding.getNameCharArray(); PDOMBinding nonLocal= FindBinding.findBinding(parent, this, nameChars, bindingTypes, 0); + if (localToFileHolder == null) + return nonLocal; + long localToFileRec= getLocalToFileRec(parent, binding, nonLocal); if (localToFileRec == 0) return nonLocal; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java index fb1c617cbcf..4f93fd5141c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 QNX Software Systems and others. + * Copyright (c) 2005, 2012 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 @@ -609,8 +609,8 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { } @Override - public final PDOMBinding adaptBinding(final IBinding inputBinding) throws CoreException { - return adaptBinding(null, inputBinding, FILE_LOCAL_REC_DUMMY); + public final PDOMBinding adaptBinding(final IBinding inputBinding, boolean includeLocal) throws CoreException { + return adaptBinding(null, inputBinding, includeLocal ? FILE_LOCAL_REC_DUMMY : null); } private final PDOMBinding adaptBinding(final PDOMNode parent, IBinding inputBinding, long[] fileLocalRecHolder) throws CoreException { @@ -661,6 +661,8 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { } if (parent == this) { PDOMBinding glob= CPPFindBinding.findBinding(getIndex(), this, binding, 0); + if (fileLocalRecHolder == null) + return glob; final long loc= getLocalToFileRec(parent, binding, glob); if (loc == 0) return glob; @@ -670,6 +672,8 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { if (parent instanceof PDOMCPPNamespace) { final BTree btree = ((PDOMCPPNamespace) parent).getIndex(); PDOMBinding glob= CPPFindBinding.findBinding(btree, this, binding, 0); + if (fileLocalRecHolder == null) + return glob; final long loc= getLocalToFileRec(parent, binding, glob); if (loc == 0) return glob; @@ -993,7 +997,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { file= wpdom.getFileForASTNode(getLinkageID(), node); } } else if (binding instanceof ICPPNamespaceAlias) { - IASTNode node= ASTInternal.getDeclaredInSourceFileOnly(binding, false, glob); + IASTNode node= ASTInternal.getDeclaredInSourceFileOnly(getPDOM(), binding, false, glob); if (node != null) { file= wpdom.getFileForASTNode(getLinkageID(), node); } @@ -1002,7 +1006,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { IBinding owner= binding.getOwner(); if (owner instanceof ICPPNamespace) { if (owner.getNameCharArray().length == 0) { - IASTNode node= ASTInternal.getDeclaredInSourceFileOnly(owner, false, glob); + IASTNode node= ASTInternal.getDeclaredInSourceFileOnly(getPDOM(), owner, false, glob); if (node != null) { file= wpdom.getFileForASTNode(getLinkageID(), node); } From d47055dbd7a0985f20a12eea852e49648c86c179 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Wed, 4 Jan 2012 12:53:19 -0500 Subject: [PATCH 2/5] Bug 367393 - [Implement Method] Refactoring wizard opens even if there are no method to implement --- .../ImplementMethodRefactoring.java | 26 ++++++++++++------- .../refactoring/implementmethod/Messages.java | 4 +-- .../implementmethod/Messages.properties | 4 +-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java index 39c713cf9a8..fde32199eaa 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik + * Copyright (c) 2008, 2012 Institute for Software, HSR Hochschule fuer Technik * Rapperswil, University of applied sciences and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -7,8 +7,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Institute for Software - initial API and implementation - * Marc-Andre Laperle + * Institute for Software - initial API and implementation + * Marc-Andre Laperle *******************************************************************************/ package org.eclipse.cdt.internal.ui.refactoring.implementmethod; @@ -91,14 +91,20 @@ public class ImplementMethodRefactoring extends CRefactoring2 { super.checkInitialConditions(sm.newChild(6)); if (!initStatus.hasFatalError()) { - data.setMethodDeclarations(findUnimplementedMethodDeclarations(pm)); + List unimplementedMethodDeclarations = findUnimplementedMethodDeclarations(pm); + if (unimplementedMethodDeclarations.isEmpty()) { + initStatus.addFatalError(Messages.ImplementMethodRefactoring_NoMethodToImplement); + } + else { + data.setMethodDeclarations(unimplementedMethodDeclarations); - if (selectedRegion.getLength() > 0) { - IASTSimpleDeclaration methodDeclaration = SelectionHelper.findFirstSelectedDeclaration(selectedRegion, astCache.getAST(tu, pm)); - if (NodeHelper.isMethodDeclaration(methodDeclaration)) { - for (MethodToImplementConfig config : data.getMethodDeclarations()) { - if (config.getDeclaration() == methodDeclaration) { - config.setChecked(true); + if (selectedRegion.getLength() > 0) { + IASTSimpleDeclaration methodDeclaration = SelectionHelper.findFirstSelectedDeclaration(selectedRegion, astCache.getAST(tu, pm)); + if (NodeHelper.isMethodDeclaration(methodDeclaration)) { + for (MethodToImplementConfig config : data.getMethodDeclarations()) { + if (config.getDeclaration() == methodDeclaration) { + config.setChecked(true); + } } } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.java index 52e3420e0d7..c3ded7f342a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2012 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 @@ -21,7 +21,7 @@ public final class Messages extends NLS { public static String ImplementMethodRefactoringPage_GeneratingPreview; public static String ImplementMethodRefactoringPage_PreviewCanceled; public static String ImplementMethodRefactoringPage_PreviewGenerationNotPossible; - public static String ImplementMethodRefactoring_NoMethodSelected; + public static String ImplementMethodRefactoring_NoMethodToImplement; public static String ImplementMethodRefactoring_MethodHasImpl; public static String ImplementMethodRefactoring_NoImplFile; public static String ImplementMethodRefactoringWizard_CancelingPreviewGeneration; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.properties index 1b60d0f979e..452aa2dddd9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik +# Copyright (c) 2008, 2012 Institute for Software, HSR Hochschule fuer Technik # Rapperswil, University of applied sciences and others # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 @@ -20,7 +20,7 @@ ImplementMethodInputPage_DeselectAll=Deselect All ImplementMethodRefactoringPage_PreviewGenerationNotPossible=Preview generation not possible ImplementMethodRefactoringPage_GeneratingPreview=Generating preview... ImplementMethodRefactoringPage_PreviewCanceled=Preview canceled -ImplementMethodRefactoring_NoMethodSelected=No method declaration selected +ImplementMethodRefactoring_NoMethodToImplement=No methods to implement found. ImplementMethodRefactoring_MethodHasImpl=This method already has an implementation. ImplementMethodRefactoring_NoImplFile=No implementation file found for one or more method. Inserting definition(s) into the header file. ImplementMethodRefactoringWizard_CancelingPreviewGeneration=Canceling preview generation \ No newline at end of file From 83a8040a2b95e2addeea5970c16d87c358c6813f Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Wed, 4 Jan 2012 11:12:04 -0800 Subject: [PATCH 3/5] Cosmetics. --- .../cdt/ui/tests/text/AbstractAutoEditTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java index b482e2b7801..b63ddf9cbe4 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AbstractAutoEditTest.java @@ -7,7 +7,7 @@ * * Contributors: * Anton Leherbauer (Wind River Systems) - initial API and implementation - * Sergey Prigogin, Google + * Sergey Prigogin (Google) * Andrew Ferguson (Symbian) * Andrew Gvozdev *******************************************************************************/ @@ -42,8 +42,7 @@ public class AbstractAutoEditTest extends BaseTestCase { * Split out from CAutoIndentTest. */ protected static class AutoEditTester { - - private IAutoEditStrategy tabsToSpacesConverter=null; + private IAutoEditStrategy tabsToSpacesConverter; private Map fStrategyMap = new HashMap(); IDocument fDoc; private String fPartitioning; @@ -236,8 +235,8 @@ public class AbstractAutoEditTest extends BaseTestCase { protected CharSequence[] getTestContents() { try { return TestSourceReader.getContentsForTest(CTestPlugin.getDefault().getBundle(), "ui", this.getClass(), getName(), 2); - } catch(IOException ioe) { - fail(ioe.getMessage()); + } catch (IOException e) { + fail(e.getMessage()); } return null; } @@ -245,8 +244,8 @@ public class AbstractAutoEditTest extends BaseTestCase { protected CharSequence[] getTestContents1() { try { return TestSourceReader.getContentsForTest(CTestPlugin.getDefault().getBundle(), "ui", this.getClass(), getName(), 1); - } catch(IOException ioe) { - fail(ioe.getMessage()); + } catch (IOException e) { + fail(e.getMessage()); } return null; } From b83af889fb09eebe07e203772bc78854a2e3a5c5 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Wed, 4 Jan 2012 11:17:04 -0800 Subject: [PATCH 4/5] Fixed breakage of lrparser and xlc tests. --- .../cdt/core/testplugin/util/TestSourceReader.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java index e4bffbbbc57..2869a337ba4 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java @@ -70,7 +70,19 @@ public class TestSourceReader { */ public static StringBuilder[] getContentsForTest(Bundle bundle, String srcRoot, Class clazz, final String testName, int sections) throws IOException { + // Walk up the class inheritance chain until we find the test method. + try { + while (clazz.getMethod(testName).getDeclaringClass() != clazz) { + clazz = clazz.getSuperclass(); + } + } catch (SecurityException e) { + Assert.fail(e.getMessage()); + } catch (NoSuchMethodException e) { + Assert.fail(e.getMessage()); + } + while (true) { + // Find and open the .java file for the class clazz. String fqn = clazz.getName().replace('.', '/'); fqn = fqn.indexOf("$") == -1 ? fqn : fqn.substring(0, fqn.indexOf("$")); String classFile = fqn + ".java"; @@ -94,6 +106,7 @@ public class TestSourceReader { BufferedReader br = new BufferedReader(new InputStreamReader(in)); try { + // Read the java file collecting comments until we encounter the test method. List contents = new ArrayList(); StringBuilder content = new StringBuilder(); for (String line = br.readLine(); line != null; line = br.readLine()) { From 76163a477c6d225b6f768585b3b84775524d3941 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Wed, 4 Jan 2012 17:44:54 -0500 Subject: [PATCH 5/5] bug 290631: Scanner Discovery Challenge. ICSettingEntry & ICDescriptionDelta as @noextend-@noimplement. --- .../model/CProjectDescriptionDeltaTests.java | 6 +-- .../.settings/.api_filters | 17 +++++++ .../settings/model/ICDescriptionDelta.java | 51 +++++++++++-------- .../core/settings/model/ICSettingEntry.java | 20 ++++++++ .../model/CProjectDescriptionDelta.java | 3 +- .../model/CProjectDescriptionManager.java | 2 +- 6 files changed, 73 insertions(+), 26 deletions(-) create mode 100644 core/org.eclipse.cdt.core/.settings/.api_filters diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java index ff562be920b..be8bd6cf0e0 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java @@ -339,7 +339,7 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase{ ICConfigurationDescription cfgDescription = prjDescription.getConfigurations()[0]; assertNotNull(cfgDescription); - // Modification SOURCE_ENTENSIONS + // Modification SOURCE_EXTENSIONS ICLanguageSetting langSetting = cfgDescription.getLanguageSettingForFile(file.getProjectRelativePath(), false); final String testContentType = CCorePlugin.CONTENT_TYPE_ASMSOURCE; langSetting.setSourceContentTypeIds(new String[] {testContentType}); @@ -356,11 +356,11 @@ public class CProjectDescriptionDeltaTests extends BaseTestCase{ // Analyze delta ICDescriptionDelta rootDelta = listener.getDelta(); assertNotNull(rootDelta); - List deltas = findDeltas(rootDelta, ICDescriptionDelta.SOURCE_ENTENSIONS); + List deltas = findDeltas(rootDelta, ICDescriptionDelta.SOURCE_EXTENSIONS); assertEquals(1, deltas.size()); ICDescriptionDelta delta = deltas.get(0); assertNotNull(delta); -// assertEquals(ICDescriptionDelta.SOURCE_ENTENSIONS, delta.getChangeFlags()); +// assertEquals(ICDescriptionDelta.SOURCE_EXTENSIONS, delta.getChangeFlags()); // Check old setting assertTrue(delta.getOldSetting() instanceof ICLanguageSetting); diff --git a/core/org.eclipse.cdt.core/.settings/.api_filters b/core/org.eclipse.cdt.core/.settings/.api_filters new file mode 100644 index 00000000000..10c87060341 --- /dev/null +++ b/core/org.eclipse.cdt.core/.settings/.api_filters @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICDescriptionDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICDescriptionDelta.java index 8467c6966c9..a38e6595eca 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICDescriptionDelta.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICDescriptionDelta.java @@ -10,7 +10,10 @@ *******************************************************************************/ package org.eclipse.cdt.core.settings.model; - +/** + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ public interface ICDescriptionDelta { /* * delta kinds @@ -18,8 +21,8 @@ public interface ICDescriptionDelta { /** * kind specifying that the setting object returned by * the {@link #getSetting()} was removed - * the {@link #getNewSetting()} returns null - * the {@link #getOldSetting()} returns the same object as {@link #getSetting()} + * the {@link #getNewSetting()} returns null + * the {@link #getOldSetting()} returns the same object as {@link #getSetting()} */ int REMOVED = 1; @@ -27,29 +30,33 @@ public interface ICDescriptionDelta { * kind specifying that the setting object returned by * the {@link #getSetting()} was added * the {@link #getNewSetting()} returns the same object as {@link #getSetting()} - * the {@link #getOldSetting()} returns null + * the {@link #getOldSetting()} returns null */ int ADDED = 2; /** * kind specifying that the setting object was changed - * the {@link #getNewSetting()} returns new object - * the {@link #getOldSetting()} returns old object + * the {@link #getNewSetting()} returns new object + * the {@link #getOldSetting()} returns old object * the {@link #getSetting()} returns the same object as {@link #getNewSetting()} */ int CHANGED = 3; - + /* * delta change flags */ - + int ACTIVE_CFG = 1; int NAME = 1 << 1; int DESCRIPTION = 1 << 2; // int PATH = 1 << 3; int LANGUAGE_ID = 1 << 4; int SOURCE_CONTENT_TYPE = 1 << 5; - int SOURCE_ENTENSIONS = 1 << 6; + /** @since 5.4 */ + int SOURCE_EXTENSIONS = 1 << 6; + /** @deprecated Use ICDescriptionDelta.SOURCE_EXTENSIONS */ + @Deprecated + int SOURCE_ENTENSIONS = SOURCE_EXTENSIONS; // int HEADER_CONTENT_TYPE = 1 << 7; // int HEADER_ENTENSIONS = 1 << 8; int SETTING_ENTRIES = 1 << 9; @@ -66,17 +73,19 @@ public interface ICDescriptionDelta { int OWNER = 1 << 20; int INDEX_CFG = 1 << 21; int SETTING_CFG = INDEX_CFG; - + /** @since 5.4 */ + int LANGUAGE_SETTINGS_PROVIDERS = 1 << 22; + /** * specifies that the project "isCdtProjectCreating" state was set to false * the PROJECT_CREAION_COMPLETED delta gets notified ONLY in case - * the project previously contained the project description with + * the project previously contained the project description with * the true "isCdtProjectCreating" state - * + * * in case the initial project description does NOT contain the true "isCdtProjectCreating" - * the project is considered as initialized from the very beginning + * the project is considered as initialized from the very beginning * and the PROJECT_CREAION_COMPLETED delta is NOT notified - * + * * @see ICProjectDescription#isCdtProjectCreating() * @see ICProjectDescription#setCdtProjectCreated() * @see ICProjectDescriptionManager#createProjectDescription(org.eclipse.core.resources.IProject, boolean, boolean) @@ -85,19 +94,19 @@ public interface ICDescriptionDelta { /** * returns the kind - * @see #ADDED - * @see #REMOVED + * @see #ADDED + * @see #REMOVED * @see #CHANGED - * + * * @return int */ int getDeltaKind(); - + /** * @return ored delta flags */ int getChangeFlags(); - + int getSettingType(); int getAddedEntriesKinds(); @@ -111,8 +120,8 @@ public interface ICDescriptionDelta { ICSettingObject getNewSetting(); ICSettingObject getSetting(); - + ICSettingObject getOldSetting(); - + ICDescriptionDelta getParent(); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICSettingEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICSettingEntry.java index 3adc824a568..af776d96bc0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICSettingEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICSettingEntry.java @@ -12,6 +12,10 @@ package org.eclipse.cdt.core.settings.model; import org.eclipse.cdt.core.model.IIncludeEntry; +/** + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. + */ public interface ICSettingEntry { /** * Flag {@code BUILTIN} indicates settings built in a tool (compiler) itself. @@ -46,6 +50,22 @@ public interface ICSettingEntry { */ int RESOLVED = 1 << 4; + /** + * Flag {@code UNDEFINED} indicates that the entry should not be defined. + * It's main purpose to provide the means to negate entries defined elsewhere. + * + * @since 5.4 + */ + int UNDEFINED = 1 << 5; + + /** + * Flag {@code FRAMEWORKS_MAC} applies for path entries. Such a path entry will be treated + * in a special way to imitate resolving paths by Apple's version of gcc, see bug 69529. + * + * @since 5.4 + */ + int FRAMEWORKS_MAC = 1 << 6; + int INCLUDE_PATH = 1; int INCLUDE_FILE = 1 << 1; int MACRO = 1 << 2; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java index 45bd1fb3b02..588d18bac0d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java @@ -168,7 +168,7 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta { if ((flags&DESCRIPTION)!=0) str.append("DESCRIPTION|"); if ((flags&LANGUAGE_ID)!=0) str.append("LANGUAGE_ID|"); if ((flags&SOURCE_CONTENT_TYPE)!=0) str.append("SOURCE_CONTENT_TYPE|"); - if ((flags&SOURCE_ENTENSIONS)!=0) str.append("SOURCE_ENTENSIONS|"); + if ((flags&SOURCE_EXTENSIONS)!=0) str.append("SOURCE_EXTENSIONS|"); if ((flags&SETTING_ENTRIES)!=0) str.append("SETTING_ENTRIES|"); if ((flags&BINARY_PARSER_IDS)!=0) str.append("BINARY_PARSER_IDS|"); if ((flags&ERROR_PARSER_IDS)!=0) str.append("ERROR_PARSER_IDS|"); @@ -182,6 +182,7 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta { if ((flags&EXT_REF)!=0) str.append("EXT_REF|"); if ((flags&OWNER)!=0) str.append("OWNER|"); if ((flags&INDEX_CFG)!=0) str.append("INDEX_CFG|"); + if ((flags&LANGUAGE_SETTINGS_PROVIDERS)!=0) str.append("LANGUAGE_SETTINGS_PROVIDERS|"); if (str.charAt(str.length()-1)=='|') str.deleteCharAt(str.length()-1); return str.toString(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java index 2143b5e9488..25bf638b9c1 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java @@ -1845,7 +1845,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { String[] newExts = newLs.getSourceExtensions(); String[] oldExts = oldLs.getSourceExtensions(); if(!Arrays.equals(newExts, oldExts)) - delta.addChangeFlags(ICDescriptionDelta.SOURCE_ENTENSIONS); + delta.addChangeFlags(ICDescriptionDelta.SOURCE_EXTENSIONS); // newCt = newLs.getHeaderContentType();