Community
Participate
Working Groups
Created attachment 86283 [details] project that can reproduce the problem Build ID: I20071213-1700 Steps To Reproduce: 1. create a plug-in project that exports annotation 2. try to import annotation in another plug-in project. It imports successfully but JDT complains that it can't find it in classpath. Note that this works fine on Eclipse 3.3 More information:
Reassigning to JDT Core since there is no annotation processing in the picture. That said: I am not able to reproduce this with M20071214-0800 (which is 3.4M4). I tried creating a new workspace and Import -> Existing projects into workspace -> Archive file, and imported both projects. I see no errors or warnings, and the annotation appears to be resolved correctly. I would note that the depending project does not have the upstream project as a plugin dependency; it only has an import-package dependency. So at runtime, the class is not going to be available unless the upstream plugin has been brought into the classloader for some other reason.
I was able to reproduce problem with different computer. Also on my eclipse, version is I20071213-1700. I don't understand why your version is different from mine. Here's my download URL http://download.eclipse.org/eclipse/downloads/drops/S-3.4M4-200712131700/index.php Note that when you open project, it doesn't show immediately the problem. If you click class "PropertyTest". The editor shows the problem. It does not show up in the problem view. I am also running Sun JDK 1.6 update 3.
Sorry, my mistake, I had a bad link. I can in fact reproduce this with the projects supplied, in 3.4M4 but not in 3.3.2. However, I have so far been unable to reproduce it with newly created projects. I am investigating to see if I can figure out what the difference is.
If I delete the comments that precede the 'package' declaration in the annotation definition, then the import problems disappear. However, I can't find anything wrong with those comments. I have even tried deleting them entirely and then inserting a new comment (just "/**/" by itself on a single line preceding the package declaration) and the problems reappear. The problems are visible only as red squiggles in the editor, not in the Problems pane. I remain unable to reproduce this in projects that I create from scratch.
I am able to reproduce this in new projects. It happens for plug-in projects and also for plain Java projects. For the import problem to appear, three things need to be true: 1. There must be a comment before the package declaration in the annotation definition. 2. The annotation must have an attribute. 3. The annotation must be in a separate project from the code that is trying to import it. The annotation and its contents do appear correctly when expanded in Package Explorer, and they auto-complete and auto-import correctly in the client code. Using a star import does not change the behavior. JDT guys, I think that's as far as I can take this one.
Created attachment 86361 [details] updated example without copyright comment
Note that: 1. the error shows in the Java editor only (not in the problem view) 2. the test case from comment 6 doesn't show the problem, only the test case from comment 0 shows the problem
Created attachment 86398 [details] Proposed fix and regression test
Fix and test released for 3.4M5
Verified for 3.4M5 using build I20080204-0010