From af52c9acc8206f75b277851dd82a5f290a433589 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 10 Jul 2015 15:23:32 -0700 Subject: [PATCH] Cosmetics. --- .../eclipse/cdt/core/dom/ast/ASTTypeUtil.java | 2 +- .../dom/PDOMProjectIndexLocationConverter.java | 18 +++++++++--------- .../core/pdom/indexer/FileExistsCache.java | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java index 0eb9bb5906a..396f6b27ee7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java @@ -905,7 +905,7 @@ public class ASTTypeUtil { switch (fname[i]) { case '/': case '\\': - return i+1; + return i + 1; } } return 0; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java index b06f7bcf375..871ddd8e4d0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java @@ -8,7 +8,7 @@ * Contributors: * Andrew Ferguson (Symbian) - initial API and implementation * Markus Schorn (Wind River Systems) - *******************************************************************************/ + *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom.dom; import java.net.URI; @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.Path; public class PDOMProjectIndexLocationConverter implements IIndexLocationConverter { private static final String EXTERNAL = ""; //$NON-NLS-1$ private static final String WS = ""; //$NON-NLS-1$ - + final private IWorkspaceRoot fRoot; final private String fFullPathPrefix; final private boolean fIgnoreExternal; @@ -43,7 +43,7 @@ public class PDOMProjectIndexLocationConverter implements IIndexLocationConverte fFullPathPrefix= project.getFullPath().toString() + IPath.SEPARATOR; fIgnoreExternal= ignoreWSExternal; } - + @Override public IIndexFileLocation fromInternalFormat(String raw) { String fullPath = null; @@ -57,30 +57,30 @@ public class PDOMProjectIndexLocationConverter implements IIndexLocationConverte if (raw.startsWith(WS)) { fullPath= raw.substring(WS.length()); } else { - fullPath= fFullPathPrefix + raw; + fullPath= fFullPathPrefix + raw; } final IPath path= new Path(fullPath); if (path.segmentCount() > 1) { IResource member= fRoot.getFile(path); uri = member.getLocationURI(); } - } + } return uri == null ? null : new IndexFileLocation(uri, fullPath); } - + @Override public String toInternalFormat(IIndexFileLocation location) { String fullPath= location.getFullPath(); if (fullPath != null) { if (fullPath.startsWith(fFullPathPrefix)) { return fullPath.substring(fFullPathPrefix.length()); - } + } return WS + fullPath; } - + if (fIgnoreExternal) return null; - + return EXTERNAL + location.getURI().toString(); } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/FileExistsCache.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/FileExistsCache.java index dceef4e088c..088dba93fb4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/FileExistsCache.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/FileExistsCache.java @@ -7,7 +7,7 @@ * * Contributors: * Markus Schorn - initial API and implementation - *******************************************************************************/ + *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom.indexer; import java.io.File; @@ -52,14 +52,14 @@ public final class FileExistsCache { // Before running out of memory the entire map will be thrown away. fCache= new SoftReference<>(cache); } - + public boolean isFile(String path) { String parent; String name; File file = null; IFileStore parentStore = null; IFileStore fileStore = null; - + if (UNCPathConverter.isUNC(path)) { try { URI uri = UNCPathConverter.getInstance().toURI(path); @@ -81,17 +81,17 @@ public final class FileExistsCache { if (BYPASS_CACHE) { return file.isFile(); } - + parent= file.getParent(); if (parent == null) return false; - + name= file.getName(); } if (fCaseInSensitive) name= name.toUpperCase(); - - Content avail= getExistsCache().get(parent); + + Content avail= getExistsCache().get(parent); if (avail == null) { String[] files = null; try { @@ -116,13 +116,13 @@ public final class FileExistsCache { if (idx < 0) return false; idx *= 2; - + final BitSet isFileBitset = avail.fIsFile; if (isFileBitset.get(idx)) return true; if (isFileBitset.get(idx + 1)) return false; - + if ((file != null && file.isFile()) || (fileStore != null && !fileStore.fetchInfo().isDirectory())) { isFileBitset.set(idx); return true;