1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-07 00:05:53 +02:00

Improvment of the file search algorithm.

This commit is contained in:
Mikhail Khodjaiants 2002-09-26 16:13:41 +00:00
parent 2d183e519d
commit 5f067307eb

View file

@ -84,7 +84,7 @@ public class CProjectSourceLocation implements ICSourceLocation
{ {
return fProject; return fProject;
} }
/*
private IFile findFile( IContainer parent, IPath name ) throws CoreException private IFile findFile( IContainer parent, IPath name ) throws CoreException
{ {
if ( name.isAbsolute() ) if ( name.isAbsolute() )
@ -109,7 +109,7 @@ public class CProjectSourceLocation implements ICSourceLocation
} }
return null; return null;
} }
*/
private Object findFileByAbsolutePath( String name ) private Object findFileByAbsolutePath( String name )
{ {
IPath path = new Path( name ); IPath path = new Path( name );
@ -169,7 +169,7 @@ public class CProjectSourceLocation implements ICSourceLocation
if ( members[i].getLocation().toOSString().equals( fileName ) ) if ( members[i].getLocation().toOSString().equals( fileName ) )
return members[i]; return members[i];
} }
else if ( members[i] instanceof IFolder ) else if ( members[i] instanceof IFolder && fileName.startsWith( members[i].getLocation().toOSString() ) )
{ {
Object result = findFile( (IContainer)members[i], fileName ); Object result = findFile( (IContainer)members[i], fileName );
if ( result != null ) if ( result != null )