Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350360

Summary: ajbuilder set problem resource and path properties in case of linked file
Product: [Tools] AJDT Reporter: Gennady Agranov <agranov>
Component: CoreAssignee: AJDT-inbox <AJDT-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: andrew.eisenberg
Version: unspecified   
Target Milestone: 2.2.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Gennady Agranov CLA 2011-06-25 14:46:30 EDT
Build Identifier: I20110613-1736

ajbuilder supposed to be replacement for javabuilder and used instead in AJDT projects.

We usually have all our sources in a shared source tree, create folders under project src folder and link these folders to this shared tree:

<link>
<name>src/com/antennasoftware/amp/studio</name>
<type>2</type>
<locationURI>VSW_DIR/source/com/antennasoftware/amp/studio</locationURI>
</link>

This approch works fine for JDT and AJDT projects - sources are found and processed.

However ajbuilder does not report correctly the resource and path in created IProblem - the folder created under src is reported as Resource and Path is simply empty - that renders ajbuilder useless in navigation from problem to the relevant line in the source.

Description	Resource	Path	Location	Type
Type safety: Unchecked invocation sort(List) of the generic method sort(List<T>) of type Collections	com.antennasoftware.amp.studio		line 817	Java Problem



 


Reproducible: Always

Steps to Reproduce:
create AJDT project with linked sources that have at least entry in the problems view, build it, double click on the problem - double click will not open editor pointed to the problem
Comment 1 Andrew Eisenberg CLA 2011-06-26 00:23:15 EDT
Can you be more precise:

1. What would you expect the problem to look like?
2. Does this happen for all problems, or only those applied to resources in linked folders?
Comment 2 Gennady Agranov CLA 2011-06-26 13:03:45 EDT
>>> 1. What would you expect the problem to look like?

"Resource" should be a file name - e.g. FieldModel.java
"Path" should be workspace relative path of the parent folder - e.g. /com.antennasoftware.amp.codegen/src/com/antennasoftware/amp/codegen/toolkit/model

BTW - line information set by ajbuilder is correct.

Example of problem created by java builder:

Description	Resource	Path	Location	Type
Type safety: The expression of type ModelFieldReference needs unchecked conversion to conform to ModelFieldReference<T>	FieldModel.java	/com.antennasoftware.amp.codegen/src/com/antennasoftware/amp/codegen/toolkit/model	line 81	Java Problem

>>> 2. Does this happen for all problems, or only those applied to resources in
linked folders?

I do not know the answer as in this project we do not have not regular source files but I am confident that there are no issues with regular source files - otherwise it would be reported and fixed long time ago.
Comment 3 Andrew Eisenberg CLA 2011-06-28 13:46:23 EDT
Consider for the 2.2.0 release.
Comment 4 Andrew Eisenberg CLA 2012-03-01 16:49:05 EST
I have finally gotten a chance to look at this.  I see that the problem comes around the way AJDT inconsistently handles linked vs regular resources.  It looks like this code has been around for a very, very long time.  Between that time and now, the APIs for dealing with linked resources have improved.

I am tempted to do a major refactoring around this area.  My only concern is that this affects other things that may not be sufficiently tested.
Comment 5 Andrew Eisenberg CLA 2012-03-01 18:48:08 EST
Fixed.  I did some refactoring and removed the old code that converts from a filesystem location to a workspace location.  We are now using appropriate Eclipse core APIs instead and things are much safer and shorter.

Will be in next snapshot build.

http://git.eclipse.org/c/ajdt/org.eclipse.ajdt.git/commit/?id=d083ede368d5b29455dd6a70af2148e88f4ddd68