From cfb2a15c27c7a1f7c3a0c2fc5a7f6e27bfaa7d6d Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 13 Jul 2005 13:02:06 +0000 Subject: [PATCH] added an additional message operation to tidy up weaver code --- .../ajdt/internal/compiler/lookup/EclipseScope.java | 5 +++++ weaver/src/org/aspectj/weaver/patterns/IScope.java | 1 + .../aspectj/weaver/patterns/ScopeWithTypeVariables.java | 7 ++++++- weaver/src/org/aspectj/weaver/patterns/SimpleScope.java | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java index 6d47044a6..ec7779ba7 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java @@ -277,6 +277,11 @@ public class EclipseScope implements IScope { .handleMessage(new Message(message, kind, null, makeSourceLocation(location))); } + + public void message(IMessage aMessage) { + getMessageHandler().handleMessage(aMessage); + } + public World getWorld() { return world.getWorld(); } diff --git a/weaver/src/org/aspectj/weaver/patterns/IScope.java b/weaver/src/org/aspectj/weaver/patterns/IScope.java index a5803489d..8b92cff03 100644 --- a/weaver/src/org/aspectj/weaver/patterns/IScope.java +++ b/weaver/src/org/aspectj/weaver/patterns/IScope.java @@ -45,6 +45,7 @@ public interface IScope { void message(IMessage.Kind kind, IHasPosition location, String message); void message(IMessage.Kind kind, IHasPosition location1, IHasPosition location2, String message); + void message(IMessage aMessage); //ISourceLocation makeSourceLocation(ILocation location); } diff --git a/weaver/src/org/aspectj/weaver/patterns/ScopeWithTypeVariables.java b/weaver/src/org/aspectj/weaver/patterns/ScopeWithTypeVariables.java index 14aeb4807..e0e24f321 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ScopeWithTypeVariables.java +++ b/weaver/src/org/aspectj/weaver/patterns/ScopeWithTypeVariables.java @@ -11,6 +11,7 @@ * ******************************************************************/ package org.aspectj.weaver.patterns; +import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.IMessage.Kind; import org.aspectj.weaver.IHasPosition; @@ -44,8 +45,8 @@ public class ScopeWithTypeVariables implements IScope { if (typeVariableNames[i].equals(name)) { if (typeVarTypeXs[i] == null) { typeVarTypeXs[i] = new UnresolvedTypeVariableReferenceType(new TypeVariable(name)); - return typeVarTypeXs[i]; } + return typeVarTypeXs[i]; } } return delegateScope.lookupType(name, location); @@ -122,4 +123,8 @@ public class ScopeWithTypeVariables implements IScope { delegateScope.message(kind,location1,location2,message); } + public void message(IMessage aMessage) { + delegateScope.message(aMessage); + } + } diff --git a/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java b/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java index a58060bc1..19b161cce 100644 --- a/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java +++ b/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java @@ -132,6 +132,10 @@ public class SimpleScope implements IScope { } + public void message(IMessage aMessage) { + getMessageHandler().handleMessage(aMessage); + } + public World getWorld() { return world; } -- 2.39.5