| author | Martin Lippert | 2013-01-10 10:11:27 (EST) |
|---|---|---|
| committer | John Arthorne | 2013-01-15 09:50:44 (EST) |
| commit | f278cf82b40cedb898bbc6a4ca3c1e6e4ca6a009 (patch) (side-by-side diff) | |
| tree | 836447cc2affb598fe3db53d767f7fc0ac81a155 | |
| parent | 1ce27d74e88dff3c150611991cf332fdc0b3a5ea (diff) | |
| download | eclipse.platform.resources-f278cf82b40cedb898bbc6a4ca3c1e6e4ca6a009.zip eclipse.platform.resources-f278cf82b40cedb898bbc6a4ca3c1e6e4ca6a009.tar.gz eclipse.platform.resources-f278cf82b40cedb898bbc6a4ca3c1e6e4ca6a009.tar.bz2 | |
bug 394607 - Poor performance when using findFilesForLocationURIv20130115-145044
| -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; } } |

