|
|
|
|
|
Re: Can invoke introduced methods [message #52723 is a reply to message #52563] |
Fri, 03 June 2005 08:24 |
Sian January Messages: 83 Registered: July 2009 |
Member |
|
|
Barry Kaplan wrote:
> I'm looking at the cross reference for an class. It shows the method
> addListener(WorkingMemoryEventListener) as an aspect declaration (it was
> introduced onto the interface).
>
> I'm also looking at the code:
>
> public void testObjectAsserted() { WorkingMemoryEventListener
> mockWorkingMemoryEventListener = ...
> WorkingMemory wm = new ForTestWorkingMemory();
> wm.addListener(mockWorkingMemoryEventListener);
> ~~~~~~~~~~~
> }
>
> Where the call to addListener is marked as undefined. There is an error
> marker in the file buffer, but not in the problems view.
> If I try to autocomplete after "wm." I get the methods that are on the
> interface prior to any introdutions. If I try to autocomplete after
> "wm.a" I get things like "adviceexecution" and "after_returning". I
> don't see these with the first autocomplete. And I never see "addListener".
> Then I run the test. Green bar! So I debug. Set a break at the second
> line, step and immediatly I'm out of the method. Appearantly returning
> normally. I put an exception block around everything. No exceptions.
> Then as I start to add some code around the problem line, I see that the
> debug lines do not even come close to the actual lines. I made sure
> inlining was off, but no effect. When I look at the "wm" variable in the
> debugger, sure enough it has all the introductions.
>
>
> [begin-crybady]
> I have worst luck with adjt. Every project I try it on, I get only so
> far and hit a wall. Up until now, always the compiler. This time I'm not
> sure what the problem is. But lots of others do ok with adjt, no? Is it
> just that I'm using the latest build? Is it that different from the near
> release candidate for eclipse 3.0.x?
> [end-crybaby]
>
> -barry
Hi Barry,
The reason for the red squiggles is that the Java editor eager parser
does not know about the ITD method. In 1.2.0 RC1 and later you can use
the AspectJ editor and get correct eager parsing. Right click on the
file, then click 'Open With' > 'AspectJ/Java Editor'. If you need to do
this a lot it is also possible to set the AspectJ editor to be the
default for .java files in the preferences.
Thanks,
Sian
|
|
|
Re: Can invoke introduced methods [message #52750 is a reply to message #52642] |
Fri, 03 June 2005 08:52 |
Eclipse User |
|
|
|
Originally posted by: clemas.uk.ibm.com
Barry Kaplan wrote:
> Barry Kaplan wrote:
>
>> Barry Kaplan wrote:
>>
>>> Strangeness continues: Now I get errors in Problems view, but all the
>>> aspectj weaving messages are gone........
>>
>>
>>
>> And it seems the reason is that nothing is getting weaved. All I did
>> was restart eclipse (I have to do this often to get the
>> cross-reference view to work again). No clue whats going on. I'll keep
>> this thread uptodate as learn anything.
>
>
> Found the problem. I left the unit test with an error in it. This seems
> to prevent /any/ weaving from occuring. Is this the desgined behavior,
> or should I file a bug?
Yes, the behavior is as designed. If you want to change this, then
there is an option 'proceed on error' that can be set on the command
line with '-proceedOnError' - I'm not sure where you can specify it in
the UI though, it is a JDT compiler option that we in AspectJ inherit.
Andy.
|
|
|
|
|
Re: Can invoke introduced methods [message #53135 is a reply to message #52777] |
Mon, 06 June 2005 07:27 |
Eclipse User |
|
|
|
Originally posted by: clemas.uk.ibm.com
As its a standard JDT Compiler option, I was expecting it could be
specified in the standard JDT Compiler options (via a checkbox) rather
than you being required to put it in the AspectJ 'non standard compiler
options' - but I can't find anywhere that suggests it can be set for
JDT. I doubt we've tested specifying it as a non-standard option on the
AJ panel, so I wouldn't be completely surprised if there was a bug
there. I'm sure it *does* work if the compiler is invoked via the
command line, so it shouldnt be tough to fix, just a bit of option wiring.
Andy.
Barry Kaplan wrote:
>>> Found the problem. I left the unit test with an error in it. This
>>> seems to prevent /any/ weaving from occuring. Is this the desgined
>>> behavior, or should I file a bug?
>>
>>
>>
>> Yes, the behavior is as designed. If you want to change this, then
>> there is an option 'proceed on error' that can be set on the command
>> line with '-proceedOnError' - I'm not sure where you can specify it in
>> the UI though, it is a JDT compiler option that we in AspectJ inherit.
>
>
> Thanks Andy. There is a place "Non standard compiler options" in the
> AspectJ page of the project properties. However, adding that option does
> not have any effect. I found several bugs related to this
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=75568,
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74245) which claim that it
> should work.
> Maybe this is a regression bug. I'll play with it some more.
|
|
|
|
Re: Can invoke introduced methods [message #53211 is a reply to message #53185] |
Mon, 06 June 2005 09:06 |
Eclipse User |
|
|
|
Originally posted by: clemas.uk.ibm.com
Helen Hawkins wrote:
> Does this JDT option do what you're looking for?
>
> Window > Preferences > Java > Compiler > Build Path > Abort builds when
> build path errors occur
>
>
>
Hmm, I thought that was more for project interdependency problems
preventing rebuilds? proceedOnError is used within a single project and
if specified means we continue to weave (as best we can) even if the
compiler reported problems. This is very useful for people that have
aspects containing declare warning/error statements, since weaving has
to occur for join points matching these statements to be reported.
Andy.
|
|
|
|
|
|
|
|
Re: Can invoke introduced methods [message #588540 is a reply to message #52563] |
Fri, 03 June 2005 08:24 |
Sian January Messages: 83 Registered: July 2009 |
Member |
|
|
Barry Kaplan wrote:
> I'm looking at the cross reference for an class. It shows the method
> addListener(WorkingMemoryEventListener) as an aspect declaration (it was
> introduced onto the interface).
>
> I'm also looking at the code:
>
> public void testObjectAsserted() { WorkingMemoryEventListener
> mockWorkingMemoryEventListener = ...
> WorkingMemory wm = new ForTestWorkingMemory();
> wm.addListener(mockWorkingMemoryEventListener);
> ~~~~~~~~~~~
> }
>
> Where the call to addListener is marked as undefined. There is an error
> marker in the file buffer, but not in the problems view.
> If I try to autocomplete after "wm." I get the methods that are on the
> interface prior to any introdutions. If I try to autocomplete after
> "wm.a" I get things like "adviceexecution" and "after_returning". I
> don't see these with the first autocomplete. And I never see "addListener".
> Then I run the test. Green bar! So I debug. Set a break at the second
> line, step and immediatly I'm out of the method. Appearantly returning
> normally. I put an exception block around everything. No exceptions.
> Then as I start to add some code around the problem line, I see that the
> debug lines do not even come close to the actual lines. I made sure
> inlining was off, but no effect. When I look at the "wm" variable in the
> debugger, sure enough it has all the introductions.
>
>
> [begin-crybady]
> I have worst luck with adjt. Every project I try it on, I get only so
> far and hit a wall. Up until now, always the compiler. This time I'm not
> sure what the problem is. But lots of others do ok with adjt, no? Is it
> just that I'm using the latest build? Is it that different from the near
> release candidate for eclipse 3.0.x?
> [end-crybaby]
>
> -barry
Hi Barry,
The reason for the red squiggles is that the Java editor eager parser
does not know about the ITD method. In 1.2.0 RC1 and later you can use
the AspectJ editor and get correct eager parsing. Right click on the
file, then click 'Open With' > 'AspectJ/Java Editor'. If you need to do
this a lot it is also possible to set the AspectJ editor to be the
default for .java files in the preferences.
Thanks,
Sian
|
|
|
|
|
|
Re: Can invoke introduced methods [message #588662 is a reply to message #52777] |
Mon, 06 June 2005 07:27 |
Andrew Clement Messages: 162 Registered: July 2009 |
Senior Member |
|
|
As its a standard JDT Compiler option, I was expecting it could be
specified in the standard JDT Compiler options (via a checkbox) rather
than you being required to put it in the AspectJ 'non standard compiler
options' - but I can't find anywhere that suggests it can be set for
JDT. I doubt we've tested specifying it as a non-standard option on the
AJ panel, so I wouldn't be completely surprised if there was a bug
there. I'm sure it *does* work if the compiler is invoked via the
command line, so it shouldnt be tough to fix, just a bit of option wiring.
Andy.
Barry Kaplan wrote:
>>> Found the problem. I left the unit test with an error in it. This
>>> seems to prevent /any/ weaving from occuring. Is this the desgined
>>> behavior, or should I file a bug?
>>
>>
>>
>> Yes, the behavior is as designed. If you want to change this, then
>> there is an option 'proceed on error' that can be set on the command
>> line with '-proceedOnError' - I'm not sure where you can specify it in
>> the UI though, it is a JDT compiler option that we in AspectJ inherit.
>
>
> Thanks Andy. There is a place "Non standard compiler options" in the
> AspectJ page of the project properties. However, adding that option does
> not have any effect. I found several bugs related to this
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=75568,
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74245) which claim that it
> should work.
> Maybe this is a regression bug. I'll play with it some more.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07750 seconds