| author | Martin Lippert | 2013-01-10 10:11:27 (EST) |
|---|---|---|
| committer | John Arthorne | 2013-01-14 15:50:06 (EST) |
| commit | 86e64a4e5c9783c2cf90504508438bf6cd4177fc (patch) (side-by-side diff) | |
| tree | 9433a71a4ffe8c8ee04eec6f1c3ff3adf3428ad7 | |
| parent | 1e20031f78a9bc8eab425b3db1e27ee9efa3bba0 (diff) | |
| download | eclipse.platform.resources-86e64a4e5c9783c2cf90504508438bf6cd4177fc.zip eclipse.platform.resources-86e64a4e5c9783c2cf90504508438bf6cd4177fc.tar.gz eclipse.platform.resources-86e64a4e5c9783c2cf90504508438bf6cd4177fc.tar.bz2 | |
| -rw-r--r-- | bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java index 7418a02..27d922a 100644 --- a/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java +++ b/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Martin Oberhuber (Wind River) - [294429] Avoid substring baggage in FileInfo + * Martin Lippert (VMware) - [394607] Poor performance when using findFilesForLocationURI *******************************************************************************/ package org.eclipse.core.internal.filesystem.local; @@ -36,6 +37,11 @@ public class LocalFile extends FileStore { */ protected final String filePath; + /** + * cached value for the toURI method + */ + private URI uri; + private static int attributes(File aFile) { if (!aFile.exists() || aFile.canWrite()) return EFS.NONE; @@ -428,6 +434,9 @@ public class LocalFile extends FileStore { * @see org.eclipse.core.filesystem.IFileStore#toURI() */ public URI toURI() { - return URIUtil.toURI(filePath); + if (this.uri == null) { + this.uri = URIUtil.toURI(filePath); + } + return this.uri; } } |

