diff options
author | Sergey Prigogin | 2012-05-02 05:38:00 +0000 |
---|---|---|
committer | Sergey Prigogin | 2012-05-02 18:43:18 +0000 |
commit | fcaa09aaf84acdfa298e4f4e9e3759954bd506c0 (patch) | |
tree | 018d9e433caf6851a026bf6a7f54bc0e9bb3e604 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core | |
parent | 64bd893b0b0ddb5efa132f0872aed99214486723 (diff) | |
download | org.eclipse.cdt-fcaa09aaf84acdfa298e4f4e9e3759954bd506c0.tar.gz org.eclipse.cdt-fcaa09aaf84acdfa298e4f4e9e3759954bd506c0.tar.xz org.eclipse.cdt-fcaa09aaf84acdfa298e4f4e9e3759954bd506c0.zip |
Cosmetics.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core')
10 files changed, 39 insertions, 44 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java index 19d1267752c..bdce87c184f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Andrew Niefer (IBM Corporation) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * Andrew Niefer (IBM Corporation) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.cpp; @@ -21,8 +21,9 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope; import org.eclipse.cdt.internal.core.dom.parser.ASTQueries; public class CPPBlockScope extends CPPNamespaceScope implements ICPPBlockScope { - public CPPBlockScope( IASTNode physicalNode ){ - super( physicalNode ); + + public CPPBlockScope(IASTNode physicalNode) { + super(physicalNode); } @Override diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java index 53afe1585d7..64883af1460 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java @@ -318,7 +318,6 @@ public class CPPNamespaceScope extends CPPScope implements ICPPInternalNamespace fInlineNamespaceDefinitions.add(nsDef); } - public static ICPPNamespaceScope[] computeEnclosingNamespaceSet(ICPPInternalNamespaceScope nsScope) { if (nsScope.isInlineNamepace()) { try { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java index 310ec0cfbeb..0c1e69f2c9f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Andrew Niefer (IBM Corporation) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * Andrew Niefer (IBM Corporation) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.cpp; @@ -42,9 +42,6 @@ public class CPPTemplateScope extends CPPScope implements ICPPTemplateScope { return (ICPPASTTemplateDeclaration) getPhysicalNode(); } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.dom.ast.cpp.ICPPScope#getScopeName() - */ @Override public IName getScopeName() { ICPPASTTemplateDeclaration template = (ICPPASTTemplateDeclaration) getPhysicalNode(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameterScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameterScope.java index 64a1905dfef..7e803caa277 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameterScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameterScope.java @@ -6,9 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.dom.parser.cpp; import org.eclipse.cdt.core.dom.IName; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java index 3ee2a3f7d21..d01278ae559 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IWritableIndex.java @@ -92,7 +92,8 @@ public interface IWritableIndex extends IIndex { /** * Makes an uncommitted file that was created earlier by calling - * {@link #addUncommittedFile(int, IIndexFileLocation, ISignificantMacros)} method visible in the index. + * {@link #addUncommittedFile(int, IIndexFileLocation, ISignificantMacros)} method visible + * in the index. * * @return The file that was updated. * @throws CoreException diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java index 984b63cdb4b..72d90942cc9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Sergey Prigogin (Google) + * Markus Schorn - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.core.parser.scanner; @@ -16,7 +16,6 @@ package org.eclipse.cdt.internal.core.parser.scanner; * @since 5.2 */ public abstract class AbstractCharArray { - /** * Returns the length of this array or -1 if it is yet, unknown. This method may be called * before the array has been traversed. @@ -25,8 +24,8 @@ public abstract class AbstractCharArray { /** * Returns the length of the array. This method is called only after the lexer has worked its - * way through the array. Therefore for subclasses it is efficient enough to read through to the - * end of the array and provide the length. + * way through the array. Therefore for subclasses it is efficient enough to read through to + * the end of the array and provide the length. */ public abstract int getLength(); @@ -37,8 +36,8 @@ public abstract class AbstractCharArray { public abstract boolean isValidOffset(int offset); /** - * Computes 64-bit hash value of the character array. This method doesn't cause any I/O if called - * after the array has been traversed. + * Computes 64-bit hash value of the character array. This method doesn't cause any I/O if + * called after the array has been traversed. * @return The hash value of the contents of the array. */ public abstract long getContentsHash(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java index 88d87b9cde1..fc66bb4a861 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java @@ -164,18 +164,20 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable { }; private static class IncludeResolution { - String fLocation; - boolean fHeuristic; + final String fLocation; + final boolean fHeuristic; + + IncludeResolution(String location, boolean heusistic) { + fLocation = location; + fHeuristic = heusistic; + } } final private IIncludeFileTester<IncludeResolution> createPathTester= new IIncludeFileTester<IncludeResolution>() { @Override public IncludeResolution checkFile(String path, boolean isHeuristicMatch, IncludeSearchPathElement onPath) { if (fFileContentProvider.getInclusionExists(path)) { - IncludeResolution res= new IncludeResolution(); - res.fHeuristic= isHeuristicMatch; - res.fLocation= path; - return res; + return new IncludeResolution(path, isHeuristicMatch); } return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CharArray.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CharArray.java index b17a4f5ebed..ba1748cf60a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CharArray.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CharArray.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Sergey Prigogin (Google) + * Markus Schorn - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.core.parser.scanner; @@ -15,7 +15,6 @@ package org.eclipse.cdt.internal.core.parser.scanner; * Wrapper around char[] to implement {@link AbstractCharArray}. */ public final class CharArray extends AbstractCharArray { - private final char[] fArray; private long hash64; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/FileCharArray.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/FileCharArray.java index 850c3afde20..eba6c0652af 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/FileCharArray.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/FileCharArray.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.core.parser.scanner; @@ -25,14 +25,13 @@ import java.nio.charset.CodingErrorAction; import org.eclipse.cdt.core.CCorePlugin; /** - * Implementation of char array for a file referencing content via - * soft references. + * Implementation of char array for a file referencing content via soft references. */ public class FileCharArray extends LazyCharArray { private static final String UTF8_CHARSET_NAME = "UTF-8"; //$NON-NLS-1$ public static AbstractCharArray create(String fileName, String charSet, InputStream in) throws IOException { - // no support for non-local files + // No support for non-local files. if (!(in instanceof FileInputStream)) { return null; } @@ -84,10 +83,9 @@ public class FileCharArray extends LazyCharArray { private String fFileName; private String fCharSet; private FileChannel fChannel; - private long fNextFileOffset= 0; - private int fNextCharOffset= 0; - private boolean fReachedEOF= false; - + private long fNextFileOffset; + private int fNextCharOffset; + private boolean fReachedEOF; private FileCharArray(String fileName, String charSet) { fFileName= fileName; @@ -192,7 +190,8 @@ public class FileCharArray extends LazyCharArray { private void decode(FileChannel channel, long fileOffset, long fileEndOffset, CharBuffer dest) throws IOException { final Charset charset = Charset.forName(fCharSet); - final CharsetDecoder decoder = charset.newDecoder().onMalformedInput(CodingErrorAction.REPLACE) + final CharsetDecoder decoder = charset.newDecoder() + .onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE); final ByteBuffer in = ByteBuffer.allocate((int) (fileEndOffset - fileOffset)); 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 d02a64f90e6..f051648d4ae 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 @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Sergey Prigogin (Google) + * Markus Schorn - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.core.parser.scanner; @@ -16,8 +16,7 @@ import java.util.ArrayList; import java.util.List; /** - * Implementation of char array for a file referencing content via - * soft references. + * Implementation of char array for a file referencing content via soft references. * Because of bug 320157 we need to deal with chunks of different length. */ public abstract class LazyCharArray extends AbstractCharArray { @@ -95,14 +94,14 @@ public abstract class LazyCharArray extends AbstractCharArray { @Override public final void arraycopy(int offset, char[] destination, int destinationPos, int length) { final Chunk chunk= getChunkForOffset(offset); - final int offsetInChunk= offset-chunk.fCharOffset; + final int offsetInChunk= offset - chunk.fCharOffset; final char[] data= getChunkData(chunk); final int maxLenInChunk = data.length - offsetInChunk; if (length <= maxLenInChunk) { System.arraycopy(data, offsetInChunk, destination, destinationPos, length); } else { System.arraycopy(data, offsetInChunk, destination, destinationPos, maxLenInChunk); - arraycopy(offset+maxLenInChunk, destination, destinationPos+maxLenInChunk, length-maxLenInChunk); + arraycopy(offset + maxLenInChunk, destination, destinationPos + maxLenInChunk, length - maxLenInChunk); } } |