Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] CDT_1_0_1: cdt.debug.core CSourceLocator.java

Could not get a correct patch, but the changelog

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


==================================
For the complete patch see in cdt-patch mailing list:
subject :
[cdt-patch] Cross-referencing projects cause the debugger to go into a stack overflow exception 

==============================================================================
 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 @@
       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 @@
     }
    }
     
  +  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 );



Back to the top