Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Simple changes in java source file causes re-compilation of all dependent files in AJDT?

Hi Andy,

Per your suggestion, we seemed to have narrowed down the problem:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344326

Let me know if you need anything else. Thanks so much for your help!
Jonathan

On Fri, Apr 29, 2011 at 8:48 AM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> I'll keep my eye out for the bugzilla coming in.
>
> It would seem to definetly be something unusual about the class(es) in
> question.  A possible strategy to narrow it down is to gradually
> remove elements of the class until incremental compiles start behaving
> - that may reveal the offending construct.  Or add an empty service
> class alongside the problematic one and gradually copy pieces over
> until incremental compilation breaks down.  I could debug it quite
> quickly if I had access to the code.  Alternatively I can add a ton
> more debug into the event trace view that says precisely why this is
> occurring - maybe I'll take a look at that.
>
> cheers
> Andy
>
> On 28 April 2011 14:54, Jonathan Su <jonathan@xxxxxxxxxxxxxx> wrote:
>> Hi Andy,
>>
>> An additional clarification:
>>
>> I'm noticing that this re-compilation of dependent classes behavior
>> seems to happen only for classes with methods that are advised by some
>> aspects. I'm not sure why it still happened when I commented out all
>> the aspects and did an Eclipse clean.
>>
>> Thanks,
>> Jonathan
>>
>> On Thu, Apr 28, 2011 at 2:17 PM, Jonathan Su <jonathan@xxxxxxxxxxxxxx> wrote:
>>> Hi Andy,
>>>
>>> Thanks for the prompt response!
>>>
>>>> Ideally sharing the source with me will be the fastest way to get it
>>>> resolved, but if that isn't possible perhaps we can narrow down the
>>>> problem:
>>>> - if you comment out the aspects (or pieces of them) does it still happen?
>>>> - anything unique about the file you are changing compared to others?
>>>> Is it affected by aspects, if so, what kind of advice/itds/declares.
>>>> Do you have inner classes? are they anonymous?
>>>
>>> To answer your questions:
>>> - I commented all of my aspects and removed the Spring aspects jars
>>> from aspect path, did a clean in Eclipse, and verified that the source
>>> class in question does not have any advised-by markers for all of its
>>> methods. This re-compilation behavior is still happening, and the
>>> event trace reports the same set of referenced files being recompiled.
>>> - The file in question is one of the commonly used "service" classes
>>> (ex: perform business logic) and the methods are advised by several
>>> aspects prior to commenting out the aspects. This behavior seems to
>>> happen for other commonly used "service" classes as well. This
>>> behavior does not seem to happen when I modify "bean" style classes
>>> (ex: basic object representation that contains mostly
>>> getters/setters). These "beans" are heavily referenced/imported
>>> throughout the code but its methods are mostly just getters/setters
>>> (and usually not advised by aspects).
>>> - The aspects I'm using are typical around advices that are scoped to
>>> either the project packages (using within) and/or to the presence of
>>> annotations, as well as the standard spring aspects (ex:
>>> transactions). There is also a before advice with similarly scoped
>>> pointcut.
>>> - There are some inner classes throughout the project, and a few
>>> anonymous ones. However, there are neither of those in the source file
>>> in question.
>>>
>>> Here's some additional information from AJDT event trace:
>>>   AJDT version: 2.1.2.e36x-20110307-1000 for Eclipse 3.6
>>>   AspectJ Compiler version: 1.6.11.RC1
>>>   usingVisualiser=true
>>>   usingXref=true
>>>   usingCUprovider=true
>>>   org.aspectj.ajdt.core.compiler.weaver.XNoInline = true
>>>   ajde.version.at.previous.startup = @AJDEVERSION@
>>>   org.aspectj.ajdt.core.compiler.problem.suppressWarnings = enabled
>>>   org.eclipse.ajdt.internal.ui.tracing.checked.filters = set: Compiler,Builder
>>>   org.aspectj.ajdt.core.compiler.lint.adviceDidNotMatch = ignore
>>>
>>> 13:34:33 Build kind = AUTOBUILD
>>> 13:34:33 Project=<project>, kind of build requested=Incremental
>>> AspectJ compilation
>>> 13:34:33 Timer event: 0ms: Flush included source file cache
>>> 13:34:33 Timer event: 4ms: Check delta
>>> 13:34:33 File: <source file path> has changed.
>>> 13:34:33 build: Examined delta - 1 changed, 0 added, and 0 deleted
>>> source files in required project <project>
>>> 13:34:33 Timer event: 5ms: Looking for and marking configuration
>>> changes in <project>
>>> 13:34:33        Configuration changes found: true
>>> 13:34:33 Timer event: 5ms: Look for source/resource changes
>>> 13:34:33 Setting list of classpath elements with modified contents:
>>> 13:34:33       []
>>> 13:34:33 Timer event: 13ms: Pre compile
>>> 13:34:33 Sending the following configuration changes to the compiler: []
>>> 13:34:33 1 source file changes since last build
>>> 13:34:33 Compiler configuration for project <project> has been read by
>>> compiler.  Resetting.
>>> 13:34:33      Configuration was []
>>> 13:34:33 Resetting list of modified source files.  Was [<source file>]
>>> 13:34:33 Preparing for build: planning to be an incremental build
>>> 13:34:33 Starting incremental compilation loop 1 of possibly 5
>>> 13:34:34 Timer event: 182ms: Time to first compiled message
>>> 13:34:34 Timer event: 258ms: Time to first woven message
>>> 13:34:34 Examining whether any other files now need compilation based
>>> on just compiling: '{<source file>}'
>>> ...
>>> determines "Need to recompile" all the referenced files
>>> ...
>>> 13:34:34 Starting incremental compilation loop 2 of possibly 5
>>> 13:34:35 Examining whether any other files now need compilation based
>>> on just compiling: '{recompiled files}'
>>> ...
>>> so on and so forth to loop 5 of 5
>>> ...
>>> 13:34:47 AspectJ reports build successful, build was: INCREMENTAL
>>> 13:34:47 AJDE Callback: finish. Was full build: false
>>> 13:34:47 Timer event: 13840ms: Total time spent in AJDE
>>> 13:34:47 Timer event: 0ms: Refresh after build
>>> 13:34:47 Types affected during build = 216
>>> 13:34:47 Timer event: 13890ms: Total time spent in AJBuilder.build()
>>> 13:34:47 Timer event: 20ms: Delete markers: <project>
>>> 13:34:47 Timer event: 5ms: Update visualizer, xref, advice listeners
>>> for (separate thread): <project>
>>> 13:34:49 Timer event: 1913ms: Create markers: <project>
>>> 13:34:49 Created 1148 markers in 216 files
>>>
>>> I will go ahead and raise a bugzilla. Please let me know if there's
>>> any other information I can provide.
>>>
>>> Thanks so much,
>>> Jonathan
>>>
>>> On Thu, Apr 28, 2011 at 12:42 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
>>>> Hi Jonathan,
>>>>
>>>>> Why is that? Why does it need to recompile all dependent source files
>>>>> when all I've changed is a whitespace or comment? Please note that I
>>>>> am not changing the aspects or pointcuts here at all. What am I
>>>>> missing? Has anyone else encountered this?
>>>>
>>>> If more than just the file you are changing gets compiled after making
>>>> a whitespace change that usually indicates a bug.  We have fixed many
>>>> of these over the years but there are still some lurking and some
>>>> characteristic of your project/source is triggering the problem.
>>>> Please raise a bugzilla for it:
>>>> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
>>>>
>>>> Ideally sharing the source with me will be the fastest way to get it
>>>> resolved, but if that isn't possible perhaps we can narrow down the
>>>> problem:
>>>> - if you comment out the aspects (or pieces of them) does it still happen?
>>>> - anything unique about the file you are changing compared to others?
>>>> Is it affected by aspects, if so, what kind of advice/itds/declares.
>>>> Do you have inner classes? are they anonymous?
>>>>
>>>> cheers
>>>> Andy
>>>>
>>>> On 28 April 2011 12:28, Jonathan Su <jonathan@xxxxxxxxxxxxxx> wrote:
>>>>> Hi there,
>>>>>
>>>>> I'm currently using Eclipse 3.6.2 with AJDT 2.1.2 (which comes with
>>>>> AspectJ 1.6.11), with incremental compilation turned on. There are a
>>>>> couple of aspects advising the java sources as well as some third
>>>>> party aspects (primarily those from Spring).
>>>>>
>>>>> I'm noticing in AJDT event trace view that when I change and save some
>>>>> java source files (not the aspect source files), it first compiles the
>>>>> changed file, then it proceed to recompile all source files that
>>>>> import the changed file. Then it recompiles files that are dependent
>>>>> on the recompiled files, so on and so forth. For some other source
>>>>> files, It doesn't seem to do this as it only recompiles the saved
>>>>> file.
>>>>>
>>>>> AJDT event trace reports successful incremental build - it compiles
>>>>> the single changed file, then it hits "Examining whether any other
>>>>> files now need compilation based on just compiling: <changed file>"
>>>>> and proceed to report that it needs to recompile all the files that
>>>>> reference the changed file. It then does this for 4 more iterations.
>>>>>
>>>>> Why is that? Why does it need to recompile all dependent source files
>>>>> when all I've changed is a whitespace or comment? Please note that I
>>>>> am not changing the aspects or pointcuts here at all. What am I
>>>>> missing? Has anyone else encountered this?
>>>>>
>>>>> Because of this behavior, merely adding a whitespace or changing
>>>>> comment causes a wait time for build, which is a behavior not present
>>>>> with JDT projects.
>>>>>
>>>>> Thanks so much for your help.
>>>>> Jonathan
>>>>> _______________________________________________
>>>>> aspectj-users mailing list
>>>>> aspectj-users@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>>>>
>>>> _______________________________________________
>>>> aspectj-users mailing list
>>>> aspectj-users@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>>>
>>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top