DESCRIPTION

Introduce a method to find projects containing paths

This is required by multiple changes, thus i split it out of
If43a04410492ee6976f00d18d99c7b0a935c0689

Change-Id: I9c85247d6e0410bc0caefd6a4594373514e16562


COMMENTS

author: Bryanna Douglas
date: 2012-03-21 12:06:20.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2012-03-21 12:06:24.000000000

Patch Set 5:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/2725/ 

-------------------------------------
author: Brenden Conley
date: 2012-03-21 12:24:09.000000000

Patch Set 5: I would prefer that you didn't submit this

Build Unstable 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/2725/ : UNSTABLE

-------------------------------------
author: Juliet Cantu
date: 2012-03-31 23:18:51.000000000

Patch Set 5: I would prefer that you didn't submit this

(1 inline comment)



Line:293, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java -> This would mean "a/b.txt" matches "a/b". Seems wrong.

-------------------------------------
author: Bryanna Douglas
date: 2012-04-02 05:22:00.000000000

Patch Set 5: (1 inline comment)



Line:293, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java -> huh? i don't understand your point. this method just checks whether the "member" has a prefix matching "prj". if it has, it returns the prj-relative path (so a substring of member starting right after the project prefix). it does not do any interpretation of the relative path. what comes in goes out again, just without the project path.

-------------------------------------
author: Juliet Cantu
date: 2012-04-22 10:15:10.000000000

Patch Set 5: (1 inline comment)



Line:293, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java -> If you have a project alpha and another called alphabeta, this method will think alphabeta/x is a member of alpha because  "fullpath/alphabeta/x".startsWith("fullpath/alpha"). Eclipse has an API for checking things like this without falling into the trap.

I wonder about the performance too.

#projects x #files is ofta a large number. It should be possible to perform a single pass over all files with an performance more like #projects + #files instead

Third, you only check whether this method return null or not, so you can avoid the substring by making the method return a boolean.

Is it necessary to canonicalize the path? The operation is very expensive. getAbsolutePath has worked this far.

-------------------------------------
