Community
Participate
Working Groups
I have the following projects structure: project test5 - uses JDK1.4.0, defines interface MyRemote: public interface MyRemote extends Remote { final static int K = 132321; public int xxx() throws RemoteException; public int yyy() throws RemoteException; } project test7 - uses project test5 and defines class Test1 which implements interface MyRemote. When my RMI builder is run, I do the following: String remote = "java.rmi.Remote"; IType type = project.findType(remote); ITypeHierarchy hierarchy = type.newTypeHierarchy(project, monitor); // project here == "test7" Later in the code I do String remote = "java.rmi.Remote"; IType type = prj.findType(remote); IType[] allSubtypes = hierarchy.getAllSubtypes(type); now "allSubTypes" does not include the class "Test". It seems to be a bug. I'm quite sure it worked before 2.0.1 Genady
I want to upload my workspace but I cannot, because problems with bugzilla
Genady, what is the project of the class "Test" (or did you mean "Test1"?) If the class "Test" doesn't belong to project "test7", then this is expected as you create the hierarchy on the project "test7". Otherwise if your workspace is not too big, could you please send it to me by email?
I cannot reproduce the problem. Here is what I did: 1. I put a breakpoint in RMIBuildAction at line 94. 2. I started your runtime-workspace under debug. 3. In the runtime-workspace, I selected 'test7' and chose RMI->Run Compiler Now 4. It hit the breakpoint The list of allSubtypes contained the class Test1.
Actually I was able to reproduce. I had mistakely fixed your projects' classpath so that they all use the same JDK version. This is the problem: 'test7' uses JDK1.3.1 in its classpath, 'test5' uses JDK1.4.0 . project.findType(remote) finds java.rmi.Remote in JDK1.3.1, but MyRemote (which is in 'test5') is a subclass of java.rmi.Remote in JDK1.4.0 . So Test1 which is a subclass of MyRemote cannot be included in the hierarchy of java.rmi.Remote in JDK1.3.1 . Closing as invalid.
You are not consisten with that. For example, the type hierarchy (when I press F4 on java.rmi.Remote) does include it. How does it get it ? I don't know. Either this situation is legal, and then I should get the class, or if it is not, JDT should warn the user about it.
On which java.rmi.Remote do you open the hierarchy? On the one in JDK1.3.1 or the one in JDK1.4.0?
There is no inconsistency here as a separate API is used in the case of F4: IType.newTypeHierarchy(IProgressMonitor). This API computes the hierarchy on the whole workspace and thus does not make a distinction between java.rmi.Remote in JDK1.3.1 and java.rmi.Remote in JDK1.4.0 .
Never mind, I don't use it anymore (I have a workaround). But I think that the current behavior must be carefully documented in order to avoid further confusion. Genady
When requesting to open a type hierarchy I see it only when I request to open the hierarchy on "java.rmi.Remote" from JDK 1.3.1. If I open the hierarchy on "Remote" from JDK 1.4.1 I do not see "Test1". I will open a bug titled "consider warning the user if a project depends on a project with a different JRE".