1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Applied patch from Tracy Miranda (bug 86540: NPE in CProjectSourceLocation).

Check for the project and synchronization are added to "initializeFolders".
This commit is contained in:
Mikhail Khodjaiants 2005-02-24 23:25:56 +00:00
parent 6dc9b768e8
commit 1a8eee1a13
2 changed files with 28 additions and 14 deletions

View file

@ -1,3 +1,8 @@
2005-02-24 Mikhail Khodjaiants
Applied patch from Tracy Miranda (bug 86540: NPE in CProjectSourceLocation).
Check for the project and synchronization are added to "initializeFolders".
* CProjectSourceLocation.java
2005-02-22 Mikhail Khodjaiants
Bug 84799: Implement Memory View and renderings with new rendering APIs.
* CMemoryBlockExtensionRetrieval.java

View file

@ -186,7 +186,9 @@ public class CProjectSourceLocation implements IProjectSourceLocation
{
if ( list.size() > 0 && !searchForDuplicateFiles() )
break;
IPath path = folders[i].getLocation().append( fileName );
IPath path = folders[i].getLocation();
if ( path != null ) {
path = path.append( fileName );
File file = new File( path.toOSString() );
if ( file.exists() )
{
@ -200,6 +202,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation
}
}
}
}
return ( list.size() > 0 ) ? ( ( list.size() == 1 ) ? list.getFirst() : list ) : null;
}
@ -351,7 +354,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation
private void initializeFolders()
{
final LinkedList list = new LinkedList();
if ( getProject() != null )
if ( getProject() != null && getProject().exists() )
{
list.add( getProject() );
try
@ -379,8 +382,14 @@ public class CProjectSourceLocation implements IProjectSourceLocation
{
}
}
synchronized( this )
{
if ( fFolders == null )
{
fFolders = (IResource[])list.toArray( new IResource[list.size()] );
}
}
}
protected IResource[] getFolders()
{