Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmanuel Graf2011-01-04 09:50:52 -0500
committerEmanuel Graf2011-01-04 09:50:52 -0500
commit41bb986be0a50e56682a60137d50743df9e07270 (patch)
tree8841cb7e95bdc758bdefc52efeee264e4e6ff7c5 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler
parent6361cd423147f917dfa76d95dddcbbfd203fdca5 (diff)
downloadorg.eclipse.cdt-41bb986be0a50e56682a60137d50743df9e07270.tar.gz
org.eclipse.cdt-41bb986be0a50e56682a60137d50743df9e07270.tar.xz
org.eclipse.cdt-41bb986be0a50e56682a60137d50743df9e07270.zip
Bug 296192: Extract method removes essential macros and breaks formatting
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296192 Bugfix patch that fixes a case where comments at the end of a block are lost for C code (Comment #2)
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenterVisitor.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenterVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenterVisitor.java
index c2c6200812..503dc28ebd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenterVisitor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenterVisitor.java
@@ -12,6 +12,7 @@
package org.eclipse.cdt.internal.core.dom.rewrite.commenthandler;
import org.eclipse.cdt.core.dom.ast.IASTComment;
+import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -29,7 +30,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
/**
* A visitor for the comments. Calls the NodeCommenter to assign the comments.
@@ -175,7 +175,7 @@ public class ASTCommenterVisitor extends CPPASTVisitor {
}
@Override
public int leave(IASTStatement statement) {
- if(statement instanceof CPPASTCompoundStatement) {
+ if(statement instanceof IASTCompoundStatement) {
return nodeCommenter.appendFreestandingComments((ASTNode)statement);
}
nodeCommenter.appendComments((ASTNode)statement);

Back to the top