summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Lippert2013-01-10 10:11:27 (EST)
committer John Arthorne2013-01-14 15:50:06 (EST)
commit86e64a4e5c9783c2cf90504508438bf6cd4177fc (patch)
tree9433a71a4ffe8c8ee04eec6f1c3ff3adf3428ad7
parent1e20031f78a9bc8eab425b3db1e27ee9efa3bba0 (diff)
downloadeclipse.platform.resources-86e64a4e5c9783c2cf90504508438bf6cd4177fc.zip
eclipse.platform.resources-86e64a4e5c9783c2cf90504508438bf6cd4177fc.tar.gz
eclipse.platform.resources-86e64a4e5c9783c2cf90504508438bf6cd4177fc.tar.bz2
bug 394607 - Poor performance when using findFilesForLocationURIv20130114-205006I20130115-0800
-rw-r--r--bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java13
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;
}
}