Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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/ASTCommenter.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java
index b891e54482..6713964575 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/commenthandler/ASTCommenter.java
@@ -83,12 +83,9 @@ public class ASTCommenter {
}
private boolean isCommentOnSameLine(IASTNode node) {
- if (node.getFileLocation() == null) {
- return false;
- } else {
- return commentNodeLocation.getStartingLineNumber() == node.getFileLocation()
- .getEndingLineNumber();
- }
+ IASTFileLocation fileLocation = node.getFileLocation();
+ return fileLocation != null &&
+ commentNodeLocation.getStartingLineNumber() == fileLocation.getEndingLineNumber();
}
@Override

Back to the top