Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no error reporting for missing OverrideAspectMethod annotation #60

Open
dvojtise opened this issue Aug 1, 2018 · 0 comments
Open

no error reporting for missing OverrideAspectMethod annotation #60

dvojtise opened this issue Aug 1, 2018 · 0 comments

Comments

@dvojtise
Copy link
Contributor

dvojtise commented Aug 1, 2018

In case of 2 base classes that inherit from each other, it is normal to have 2 aspects that inherit from each other that each point to its base class.

The annotation OverrideAspectMethod is used to both generate the super_ method method but also remind to the user that it overrides another method.

There is some code for checking that this annotation is correctly put, but it doesn't seem to work.

the following code does not report error (or at least a warning) about it

class Parent {
	public String name 
	new(String name){
		this.name = name
	}
} 
 
class ChildA   extends Parent{
	new(String name){
		super(name)
	}
}

@Aspect(className=typeof(Parent)) 
class ParentAspect {
	public def String myOperation() {
		"myOperation ParentAspect("+_self.name+")"
	} 
	public def String myOperation2() {
		"myOperation2 ParentAspect("+_self.name+")"
	}
} 
 
@Aspect(className=typeof(ChildA)) 
class ChildAAspect   extends ParentAspect{
	public def String myOperation() {        // An error should be reported here !!!
        // due to missing annotatio call to super is not possible
		"myOperation ChildAAspect("+_self.name+")"
	}
	@OverrideAspectMethod
	public def String myOperation2() {
		"myOperation2 ParentAspect("+_self.name+")[" + _self.super_myOperation2 +"]"
	}
}

Note: this must not be confused with the override modifier used when an aspect on a base class is refined by another aspect on the same base class as below:

@Aspect(className=typeof(ChildA)) 
class ChildAAspect2   extends ChildAAspect{
	override String myOperation() {
		"myOperation ChildAAspect("+_self.name+")"
	}	
	override String myOperation2() {
		"myOperation2 ParentAspect("+_self.name+")"
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant