From 16f230e2a4c54122b7641f80d973df938d79490a Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 10 Apr 2011 02:48:58 +0000 Subject: [PATCH] Cosmetics. --- .../internal/core/model/TranslationUnit.java | 2 +- .../rewrite/commenthandler/ASTCommenter.java | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java index 5f9699aa787..a3ecf626959 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java @@ -800,7 +800,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit { } final IParserLogService log; if (monitor instanceof ICanceler) { - log= new ParserLogService(DebugLogConstants.PARSER, (ICanceler)monitor); + log= new ParserLogService(DebugLogConstants.PARSER, (ICanceler) monitor); } else { log= ParserUtil.getParserLogService(); } 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 e8e2c76f804..25620836f9d 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 @@ -192,7 +192,7 @@ public class ASTCommenter { private static ArrayList getCommentsInWorkspace(IASTTranslationUnit tu) { IASTComment[] comments = tu.getComments(); - ArrayList commentsInWorksapce = new ArrayList(); + ArrayList commentsInWorkspace = new ArrayList(); if (comments == null || comments.length == 0) { return null; @@ -200,15 +200,16 @@ public class ASTCommenter { for (IASTComment comment : comments) { if (isInWorkspace(comment)) { - commentsInWorksapce.add(comment); + commentsInWorkspace.add(comment); } } - return commentsInWorksapce; + return commentsInWorkspace; } - private static ArrayList removeAllPreprocessorComments(IASTTranslationUnit tu, ArrayList comments) { + private static ArrayList removeAllPreprocessorComments(IASTTranslationUnit tu, + ArrayList comments) { IASTPreprocessorStatement[] preprocessorStatements = tu.getAllPreprocessorStatements(); - TreeMap treeOfPreProcessorLines = new TreeMap(); + TreeMap treeOfPreProcessorLines = new TreeMap(); TreeMap> ppOffsetForFiles = new TreeMap>(); for (IASTPreprocessorStatement statement : preprocessorStatements) { @@ -229,11 +230,11 @@ public class ASTCommenter { int comStartLineNumber = OffsetHelper.getStartingLineNumber(comment); String fileName = comment.getFileLocation().getFileName(); if (treeOfPreProcessorLines.containsKey(comStartLineNumber) - && treeOfPreProcessorLines.get(comStartLineNumber).equals(fileName - )) { - continue; + && treeOfPreProcessorLines.get(comStartLineNumber).equals(fileName)) { + continue; } - if (commentIsAtTheBeginningBeforePreprocessorStatements(comment, ppOffsetForFiles.get(fileName), tu)) { + if (commentIsAtTheBeginningBeforePreprocessorStatements(comment, + ppOffsetForFiles.get(fileName), tu)) { continue; } commentsInCode.add(comment); @@ -284,7 +285,8 @@ public class ASTCommenter { return false; } - private static NodeCommentMap addCommentsToCommentMap(IASTTranslationUnit rootNode, ArrayList comments){ + private static NodeCommentMap addCommentsToCommentMap(IASTTranslationUnit rootNode, + ArrayList comments){ NodeCommentMap commentMap = new NodeCommentMap(); CommentHandler commHandler = new CommentHandler(comments);