diff options
author | Nathan Ridge | 2018-03-30 06:01:59 +0000 |
---|---|---|
committer | Nathan Ridge | 2018-04-05 20:25:44 +0000 |
commit | a10fc3eafed692623ea110ee46de35f3f3965b2b (patch) | |
tree | 207d6cbfa90e74c2d6bd8ed9e2d6c9b283ed1bb4 | |
parent | f80be34148634c16221f9ae9ef673d7df1465e40 (diff) | |
download | org.eclipse.cdt-a10fc3eafed692623ea110ee46de35f3f3965b2b.tar.gz org.eclipse.cdt-a10fc3eafed692623ea110ee46de35f3f3965b2b.tar.xz org.eclipse.cdt-a10fc3eafed692623ea110ee46de35f3f3965b2b.zip |
Bug 532781 - Ensure the model builder looks up SourceManipulationInfo for anonymous namespaces in its local cache
Change-Id: I98ff370d4cd04254d8896409455fae61182fb3df
-rw-r--r-- | core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java index 2358dbf36e7..e2e689cfd90 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java @@ -514,7 +514,9 @@ public class CModelBuilder2 implements IContributedModelBuilder { } else { final IASTFileLocation nsLocation= declaration.getFileLocation(); if (nsLocation != null) { - element.setIdPos(nsLocation.getNodeOffset(), type.length()); + // Note: don't want to call element.setIdPos(), because we want the SourceManipulationInfo + // lookup to go through the local 'fNewElements' cache. + getSourceManipulationInfo(element).setIdPos(nsLocation.getNodeOffset(), type.length()); } } setBodyPosition(element, declaration); @@ -1194,12 +1196,11 @@ public class CModelBuilder2 implements IContributedModelBuilder { * * @param element * @param astName - * @throws CModelException */ - private void setIdentifierPosition(SourceManipulation element, IASTName astName) throws CModelException { + private void setIdentifierPosition(SourceManipulation element, IASTName astName) { setIdentifierPosition(getSourceManipulationInfo(element), astName); } - + /** * Utility method to set the identifier position of an element from an AST name. * |