Bug 80672 - [1.5] Annotation change does not trigger recompilation
Summary: [1.5] Annotation change does not trigger recompilation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-10 04:44 EST by Philipe Mulet CLA
Modified: 2004-12-15 12:33 EST (History)
1 user (show)

See Also:


Attachments
Patch for ClassFileReader (rooted at project) (1.86 KB, patch)
2004-12-10 05:04 EST, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2004-12-10 04:44:48 EST
Build 20041207

Define 2 files:
p/Use.java===================================
package p;
@q.Ann
public class Use {
}
q/Ann.java===================================
package q;
public @interface Ann {
}


Build - all is fine

Now incrementally change q/Ann.java to:
package q;
import java.lang.annotation.*;
@Target(ElementType.METHOD)
public @interface Ann {
}
 
Build - still fine though p/Use.java should have got a problem due to disallowed
location for use of annotation @Ann.
Comment 1 Philipe Mulet CLA 2004-12-10 04:47:36 EST
Problem comes from classfile comparator which should consider some standard
annotation changes as structural changes.

Considering how the compiler works, it could minimally consider as structurally
changed if:
- target
- deprecation

have changed (@Override/@SuppressWarnings have only local impact, and others are
ignored for now)
Comment 2 Philipe Mulet CLA 2004-12-10 04:48:02 EST
Should then add some builder test
Comment 3 Philipe Mulet CLA 2004-12-10 05:04:46 EST
Created attachment 16509 [details]
Patch for ClassFileReader (rooted at project)

Checked Target&Deprecated on types, Deprecated only for field&method
Comment 4 Philipe Mulet CLA 2004-12-10 06:56:16 EST
Released the patch, pls double check and annotate build notes if ok.
Comment 5 Jerome Lanneluc CLA 2004-12-10 07:16:09 EST
Added test Java50Tests#_testAnnotation(). Please enable when this bug is fixed.
Comment 6 Jerome Lanneluc CLA 2004-12-10 07:17:38 EST
Since patch was released, enabled the test.
Comment 7 Olivier Thomann CLA 2004-12-10 08:21:56 EST
Verified. Change looks good.
Updated the build notes.
Comment 8 Olivier Thomann CLA 2004-12-10 08:26:06 EST
I also added the retention as part of the check, because it has an impact on the
kind of attributes that are generated. They can become visible or invisible.
So dependant classes should be recompiled if the retention is different.
Comment 9 Philipe Mulet CLA 2004-12-10 08:58:44 EST
Ok
Comment 10 Frederic Fusier CLA 2004-12-15 12:33:44 EST
Verified for 3.1 M4 using build I200412142000.