Bug 238542 - return types don't match errors when exporting an aspect project to jar file
Summary: return types don't match errors when exporting an aspect project to jar file
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.5.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-26 05:47 EDT by Christian Kuen CLA
Modified: 2008-06-30 15:55 EDT (History)
1 user (show)

See Also:


Attachments
jar file that includes a aspectJ project to extend classes with Names (9.85 KB, application/java-archive)
2008-06-26 05:58 EDT, Christian Kuen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Kuen CLA 2008-06-26 05:47:28 EDT
Build ID: M20080221-1800

Steps To Reproduce:
1. i'm estending existing classes with additional methods and a LinkdHashSet which contains "Name" objects. 

private LinkedHashSet<Name> Nameable.nameSet = new LinkedHashSet<Name>();


2. everything works fine until i export the project to jar and use the jar file in another project. if i do so i get following error message:

can't override java.util.LinkedHashSet<Name> Nameable.getNames() with java.util.LinkedHashSet Name.getNames() return types don't match
 
3. if i remove the type at the LinkedHashSet that it looks like this:

private LinkedHashSet Nameable.nameSet = new LinkedHashSet();

it works but then there are the ugly warnings and it is not typesafe.


More information:
Comment 1 Christian Kuen CLA 2008-06-26 05:58:47 EDT
Created attachment 105870 [details]
jar file that includes a aspectJ project to extend classes with Names

to test you can use the naming.jar in a new project.

create a empty class that implements "Nameable".

the errors messages should appear in eclipse.

if you remove the type for the LinkedHashSet in the jar file it works, but with warnings and not typesafe.
Comment 2 Andrew Clement CLA 2008-06-26 12:18:20 EDT
Are you really on AspectJ 1.5.2?  Or are you on AJDT 1.5.2?  

The latest AspectJ (1.6.1rc1) includes many fixes, one of which addresses exactly the error you describe.  This AspectJ is included in the current AJDT dev builds for Eclipse 3.3.  Please try out the latest AJDT/AspectJ and see if that fixes your issue.
Comment 3 Christian Kuen CLA 2008-06-30 15:54:05 EDT
use this update site in eclipse and it works...

http://download.eclipse.org/tools/ajdt/33/dev/update
Comment 4 Christian Kuen CLA 2008-06-30 15:55:04 EDT
Thanks to Andy