mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Cross-referencing projects cause the debugger to go into a stack overflow exception.
Make sure that there is only one source location for each referenced project.
This commit is contained in:
parent
eb65a10890
commit
fa3f6e5e4c
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-03-14 Mikhail Khodjaiants
|
||||
Cross-referencing projects cause the debugger to go into a stack overflow exception.
|
||||
Make sure that there is only one source location for each referenced project.
|
||||
* CSourceLocator.java
|
||||
|
||||
2003-03-13 Alain Magloire
|
||||
|
||||
No longer throw exceptions.
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.io.IOException;
|
|||
import java.io.StringReader;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
|
@ -214,7 +215,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
|||
IProject[] projects = project.getReferencedProjects();
|
||||
for ( int i = 0; i < projects.length; i++ )
|
||||
{
|
||||
if ( projects[i].exists() )
|
||||
if ( projects[i].exists() && !containsProject( list, projects[i] ) )
|
||||
{
|
||||
list.add( new CProjectSourceLocation( projects[i] ) );
|
||||
addReferencedSourceLocations( list, projects[i] );
|
||||
|
@ -228,6 +229,18 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean containsProject( List list, IProject project )
|
||||
{
|
||||
Iterator it = list.iterator();
|
||||
while( it.hasNext() )
|
||||
{
|
||||
CProjectSourceLocation location = (CProjectSourceLocation)it.next();
|
||||
if ( project.equals( location.getProject() ) )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private Object findFileByAbsolutePath( String fileName )
|
||||
{
|
||||
Path path = new Path( fileName );
|
||||
|
|
Loading…
Add table
Reference in a new issue