From 4bb004213a16d0776e7eff0eec146b211a7e5c3b Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 24 Aug 2010 05:26:51 +0000 Subject: [PATCH] Cosmetics. --- .../internal/core/model/TranslationUnit.java | 2 +- .../core/parser/scanner/LazyCharArray.java | 2 +- .../internal/core/parser/scanner/Lexer.java | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 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 e67812cf54b..3b3f5e764d4 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 @@ -794,7 +794,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit { } else { log= ParserUtil.getParserLogService(); } - return ((AbstractLanguage)language).getASTTranslationUnit(fileContent, scanInfo, crf, index, options, log); + return ((AbstractLanguage) language).getASTTranslationUnit(fileContent, scanInfo, crf, index, options, log); } } return null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java index 7a4a92e8994..d5f6e3324aa 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LazyCharArray.java @@ -100,7 +100,7 @@ public abstract class LazyCharArray extends AbstractCharArray { int chunkOffset= offset >> CHUNK_BITS; int loffset= offset & (CHUNK_SIZE - 1); char[] data= getChunkData(chunkOffset); - final int canCopy = data.length-loffset; + final int canCopy = data.length - loffset; if (length <= canCopy) { System.arraycopy(data, loffset, destination, destinationPos, length); return; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java index 56c05d56c1f..48ab6135b37 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Lexer.java @@ -187,7 +187,7 @@ final public class Lexer implements ITokenSequence { public final int consumeLine(int origin) throws OffsetLimitReachedException { Token t= fToken; Token lt= null; - while(true) { + while (true) { switch(t.getType()) { case IToken.tCOMPLETION: if (lt != null) { @@ -222,7 +222,7 @@ final public class Lexer implements ITokenSequence { fInsideIncludeDirective= false; final Token t= fToken; boolean haveNL= t==null || t.getType() == tNEWLINE; - while(true) { + while (true) { final boolean hadNL= haveNL; haveNL= false; final int start= fOffset; @@ -337,7 +337,7 @@ final public class Lexer implements ITokenSequence { * Computes the next token. */ private Token fetchToken() throws OffsetLimitReachedException { - while(true) { + while (true) { final int start= fOffset; final int c= fCharPhase3; final int d= nextCharPhase3(); @@ -367,12 +367,12 @@ final public class Lexer implements ITokenSequence { case 'u': case 'U': - if(fOptions.fSupportUTFLiterals) { - if(d == '"') { + if (fOptions.fSupportUTFLiterals) { + if (d == '"') { nextCharPhase3(); return stringLiteral(start, c == 'u' ? IToken.tUTF16STRING : IToken.tUTF32STRING); } - if(d == '\'') { + if (d == '\'') { nextCharPhase3(); return charLiteral(start, c == 'u' ? IToken.tUTF16CHAR : IToken.tUTF32CHAR); } @@ -730,7 +730,7 @@ final public class Lexer implements ITokenSequence { private void blockComment(final int start, final char trigger) { // we can ignore line-splices, trigraphs and windows newlines when searching for the '*' int pos= fEndOffset; - while(isValidOffset(pos)) { + while (isValidOffset(pos)) { if (fInput.get(pos++) == trigger) { fEndOffset= pos; if (nextCharPhase3() == '/') { @@ -747,7 +747,7 @@ final public class Lexer implements ITokenSequence { private void lineComment(final int start) { int c= fCharPhase3; - while(true) { + while (true) { switch (c) { case END_OF_INPUT: case '\n': @@ -1073,7 +1073,7 @@ final public class Lexer implements ITokenSequence { return c; } } - while(true); + while (true); } /** @@ -1103,7 +1103,7 @@ final public class Lexer implements ITokenSequence { private int findEndOfLineSpliceSequence(int pos) { boolean haveBackslash= true; int result= -1; - loop: while(isValidOffset(pos)) { + loop: while (isValidOffset(pos)) { switch(fInput.get(pos++)) { case '\n': if (haveBackslash) {