Bug 285188 - declare error/warning produces marker on wrong resource
Summary: declare error/warning produces marker on wrong resource
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 13:03 EDT by Konstantin Titorenko CLA
Modified: 2012-04-03 14:12 EDT (History)
1 user (show)

See Also:


Attachments
Bug fix (1.42 KB, text/plain)
2009-08-03 17:09 EDT, Konstantin Titorenko CLA
andrew.eisenberg: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Titorenko CLA 2009-07-30 13:03:41 EDT
Build ID: 20090619-0625

Steps To Reproduce:
1. Create AspectJ project with aspect:
declare error : call(* *.*(..)): "test message";
2. Create Java project with one class and one method. Add dependency to it to AspectJ Inpath of first project -> Problem view updates, with one error on correct resource. You can double-click and navigate to correct resource.
3. Add yet another Java project. Add it to Build path of AspectJ project -> Problem view still has one item, but you can not navigate to resouce and path column is empty.


More information:
Reproduces on AJDT 2.0.0 and  2.0.1.e35x-20090727-2200

In scenario above org.eclipse.ajdt.internal.ui.ajde.UIMessageHandler.locationToResource
returns null, but ISourceLocation isl parameter seems to be correctly initialized. 

I think that this this call is not working:

if (ir == null) {
            // try any project
            ir = AJDTUtils.findResource(loc);

So locationToResource returns null and this seem to cause the problem
Comment 1 Andrew Eisenberg CLA 2009-07-30 15:10:56 EDT
Thanks for the report and the suggested location where things are going wrong.  I will have a look at this in the next few days.

I am actually surprised that navigation is working at all between projects for declare warning/error. 
Comment 2 Konstantin Titorenko CLA 2009-08-03 17:09:12 EDT
Created attachment 143328 [details]
Bug fix

This patch fixes the problem, org.eclipse.ajdt.internal.ui.ajde.UIMessageHandler.tryToFindResource method was not returning not null value.
Comment 3 Andrew Eisenberg CLA 2009-08-03 23:04:36 EDT
Thanks for the patch.  I'll have a look at it later this week.
Comment 4 Andrew Eisenberg CLA 2009-08-12 18:51:13 EDT
Patch has been applied and your test case is working.  I am now using it as a regression test.

Will be available in the next dev build of the 3.5 stream.  However, that may not come out for another few days.