| Summary: | Incorrect advising in eclipse vs reality | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] AJDT | Reporter: | Niklas Lönn <niklas.lonn> | ||||||
| Component: | Core | Assignee: | AJDT-inbox <AJDT-inbox> | ||||||
| Status: | RESOLVED INVALID | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | andrew.eisenberg | ||||||
| Version: | 2.1.3 | ||||||||
| Target Milestone: | 2.1.3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Niklas Lönn
Created attachment 203749 [details]
Screenshot of Main output vs eclipse advices
Here's a screenshot of the problem
Created attachment 203750 [details]
Eclipse project
Didn't find this attachment, so i upload it again, just in case
I understand the confusion, but this is the expected behavior. In your example project, notice how there is a '?' in the advice markers. This means that the application cannot be completely determined at compile time (ie- there is a runtime test).
Look at your pointcut:
pointcut getName(Friend this_) : execution(String getName(..)) && this(this_);
It says that the runtime type of this_ must implement Friend and it must have a getName() method.
Consider this class:
class YesAFriend extends NotAFriend implements Friend { }
For calls to getName() when the instance is of type YesAFriend, this advice will apply. And that is why there is a runtime test of NotAFriend.getName().
|