mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
Cosmetics.
This commit is contained in:
parent
ebe2262314
commit
af52c9acc8
3 changed files with 19 additions and 19 deletions
|
@ -905,7 +905,7 @@ public class ASTTypeUtil {
|
|||
switch (fname[i]) {
|
||||
case '/':
|
||||
case '\\':
|
||||
return i+1;
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -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 = "<EXT>"; //$NON-NLS-1$
|
||||
private static final String WS = "<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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue