Bug 371457 - AJDT claims undefined constructor when @DeclareMixing inter-type defined
Summary: AJDT claims undefined constructor when @DeclareMixing inter-type defined
Status: NEW
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-14 04:07 EST by art y CLA
Modified: 2012-02-14 11:36 EST (History)
2 users (show)

See Also:


Attachments
DeclareMixingMessingConstructorTest sample project to repro the error (104.60 KB, application/octet-stream)
2012-02-14 04:08 EST, art y CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description art y CLA 2012-02-14 04:07:07 EST
Build Identifier: Build Identifier: Version: Indigo Service Release 1, Build id: 20110916-0149, Version: 2.1.3.e37x-20110628-1900, AspectJ version: 1.6.12.20110613132200

When @DeclareMixing inter-type is defined for a class and the constructor of that (non inter-type) class takes argument(s), AJDT claims that constructor as undefined.

With the following example codes, AJDT claims that MixeeClass1( String newStr) constructor is undefined. However, it can be built and run normally.


public static interface MixinInterface {
	public void mixinInterfaceMethod();
}
public static class MixinClass implements MixinInterface {
	ForDeclareMixin forDeclareMixin = null;
	public MixinClass( ForDeclareMixin forDeclareMixin) {
		this.forDeclareMixin = forDeclareMixin;
	}
	
	public void mixinInterfaceMethod() {
		forDeclareMixin.addStrToStrList( "mixinInterfaceMethod");
	}
}

public static class MixeeClass1 extends ForDeclareMixin {
	public MixeeClass1() {
		super();
		this.addStrToStrList( "MixeeClass1()");
	}
	public MixeeClass1( String newStr) {
		super();
		this.addStrToStrList( "MixeeClass1( " + newStr + ")");
	}
}

@DeclareMixin( value="aspectJTest.DeclareMixinAspect.MixeeClass1")
public static MixinInterface addMixinInterfaceInterface( Object instance) {
	return new MixinClass( (MixeeClass1)instance);
}

@Around( 
	value="execution( * aspectJTest.ForDeclareMixin+.getStrList()) " 
			+ "&& this( mixinInterface)"
	)
public Object aroundAdvisedOMethod( 
		ProceedingJoinPoint proceedingJoinPoint, MixinInterface mixinInterface) {
			
	mixinInterface.mixinInterfaceMethod();
	
	try {
		return proceedingJoinPoint.proceed();
	}
	catch( Throwable throwable) {
		if ( throwable instanceof RuntimeException) {
			throw (RuntimeException)throwable;
		}
		else {
			throw new RuntimeException( throwable);
		}
	}
}


Reproducible: Always

Steps to Reproduce:
1. Import DeclareMixingMessingConstructorTest sample AspectJ project from the attached DeclareMixingMessingConstructorTest.zip file.
2. Open DeclareMixingTest.java file with Eclipse. 
AJDT claims that DeclareMixinAspect.MixeeClass1 constructor with String argument is undefined.
Please take a look at ScreenCopy.JPG file at the root of DeclareMixingMessingConstructorTest sample AspectJ project as the screen copy of that error.
Comment 1 art y CLA 2012-02-14 04:08:18 EST
Created attachment 210959 [details]
DeclareMixingMessingConstructorTest sample project to repro the error
Comment 2 Andrew Clement CLA 2012-02-14 11:30:30 EST
as the error only appears in the editor, and not in the problems view, I'm transferring to AJDT.
Comment 3 Andrew Eisenberg CLA 2012-02-14 11:36:23 EST
It's likely that this is an error that is leaking through the Java reconciler.  I'll have a look.