Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-03-30 06:01:59 +0000
committerNathan Ridge2018-04-05 20:25:44 +0000
commita10fc3eafed692623ea110ee46de35f3f3965b2b (patch)
tree207d6cbfa90e74c2d6bd8ed9e2d6c9b283ed1bb4
parentf80be34148634c16221f9ae9ef673d7df1465e40 (diff)
downloadorg.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
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java9
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.
*

Back to the top