Summary: | Changing constant value does not cause recompilation of code that uses it | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Guillaume Pothier <gpothier> | ||||
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | major | ||||||
Priority: | P2 | CC: | aclement, Olivier_Thomann | ||||
Version: | DEVELOPMENT | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Guillaume Pothier
2009-11-22 20:50:30 EST
(In reply to comment #0) > In my project, this problem is 100% reproducible. However, I created a test > project with just two classes (one that defines the constant, another one that > uses it, and the problem does not occur). Please tell me if I should upload my > project somewhere so that the bug can be tracked down. Could you please attach your project to this bug report? Thanks. Created attachment 152883 [details]
Zipped workspace exhibiting the bug
Note that the workspace is full of errors because I did not include the dependencies, but it doesn't prevent the bug from manifesting.
Steps to reproduce:
1. Execute tod.impl.evdbng.db.file.TestMinMaxTree (in src/test) as a Java application (*not* as a JUnit test)
2. Observe printed value.
3. Change the value of the PagedFile.PAGE_SIZE constant.
4. Execute the program again.
5. The printed value remains the same.
You are using aspectJ. Is that properly installed ? What version of AspectJ are you using ? Do you get the same behavior using a pure java project ? AspectJ problem indeed, converting the same project to a Java-only project makes the problem disappear. I changed the Product to AJDT then. I just tested again with a freshly installed Eclipse 3.5.1, and freshly installed AJDT from http://download.eclipse.org/tools/ajdt/35/update The problem occurs whether or not the Incremental Compiler Optimizations option is checked. Actually, reproducing the bug is much simpler now that we know it is an AJDT problem: 1. Create a new AJDT project 2. Create a class named Def: public class Def { public static final int D = 3; } 3. Create a class named Use: public class Use { public static void main(String[] args) { System.out.println(Def.D); } } 4. Execute class Use, observe output 5. Change the value of Def.D 6. Execute Use again, output does not change I guess the big attachment can be deleted now, if possible; I don't know how to do it myself. Looks AspectJ rather than AJDT. Wonder which part of incremental compilation is to blame... Could be AspectJ itself or it could be us missing a fix from Eclipse JDT since AspectJ is based on eclipse compiler level 785 (from Eclipse 3.3) unsetting the target field which is currently set for something already released |