diff options
author | aclement <aclement> | 2005-04-19 12:19:12 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-04-19 12:19:12 +0000 |
commit | 278bdc1baabe0901114b8fb4dfe4261df33dd286 (patch) | |
tree | fae5c8c9172b5ae39d9918147dd3c3dc99610669 /weaver | |
parent | df146370298318de22a449472d680c8259fecbc1 (diff) | |
download | aspectj-278bdc1baabe0901114b8fb4dfe4261df33dd286.tar.gz aspectj-278bdc1baabe0901114b8fb4dfe4261df33dd286.zip |
from branch: binding rules different for @AJ
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/Bindings.java | 7 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/FormalBinding.java | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/Bindings.java b/weaver/src/org/aspectj/weaver/patterns/Bindings.java index cf9e660a5..78b61a643 100644 --- a/weaver/src/org/aspectj/weaver/patterns/Bindings.java +++ b/weaver/src/org/aspectj/weaver/patterns/Bindings.java @@ -108,7 +108,12 @@ public class Bindings { public void checkAllBound(IScope scope) { for (int i=0, len=bindings.length; i < len; i++) { if (bindings[i] == null) { - scope.message(IMessage.ERROR, scope.getFormal(i), "formal unbound in pointcut"); + // ATAJ: avoid warnings for implicit bindings + if (scope.getFormal(i) instanceof FormalBinding.ImplicitFormalBinding) { + bindings[i] = new BindingTypePattern(scope.getFormal(i), false); + } else { + scope.message(IMessage.ERROR, scope.getFormal(i), "formal unbound in pointcut "); + } } } diff --git a/weaver/src/org/aspectj/weaver/patterns/FormalBinding.java b/weaver/src/org/aspectj/weaver/patterns/FormalBinding.java index 589b1d0f0..9a2fa8b3c 100644 --- a/weaver/src/org/aspectj/weaver/patterns/FormalBinding.java +++ b/weaver/src/org/aspectj/weaver/patterns/FormalBinding.java @@ -74,4 +74,16 @@ public class FormalBinding implements IHasPosition { public static final FormalBinding[] NONE = new FormalBinding[0]; + /** + * A marker class for bindings for which we want to ignore unbound issue and consider + * them as implicit binding - f.e. to handle JoinPoint in @AJ advices + * + * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> + */ + public static class ImplicitFormalBinding extends FormalBinding { + public ImplicitFormalBinding(TypeX type, String name, int index) { + super(type, name, index); + } + } + } |