Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] problem on IJavaProject.findType

hi,all
 
    I am doing migration for my plugins from eclipse2.0 to eclipse3.1 recently,and I have a problem on the IJavaProject.findType API as following.
   I have two projects created in the workspace,one called "project1",another called "project2",and a java source file named "test.TestClass" created in project1.After all that done,I open the test.TestClass  in the Editor and execute the following code.
 
               IJavaProject project2 = ......; //the handler of project2
               IType type = project2.findType("test.TestClass");  //find tye TestClass Type
               assert(type == null); //I except the type would be null,for there is no any source file or binary class file in project2
                                                 //but it is not null in fact,the findType method returns the test.TestClass IType in project1
                                                                               
   As the code shows,the project2.findType("test.TestClass") returns not null if the test.TestClass source file left open in the editor(no matter what editor it is),but returns null if I closed this source file in the editor.So,that is the problem,can anyone help me.I except the project2.findType to return null even if I have the test.TestClass source file opened in the editor.
              
 

Back to the top