]> source.dussan.org Git - aspectj.git/commitdiff
added an additional message operation to tidy up weaver code
authoracolyer <acolyer>
Wed, 13 Jul 2005 13:02:06 +0000 (13:02 +0000)
committeracolyer <acolyer>
Wed, 13 Jul 2005 13:02:06 +0000 (13:02 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java
weaver/src/org/aspectj/weaver/patterns/IScope.java
weaver/src/org/aspectj/weaver/patterns/ScopeWithTypeVariables.java
weaver/src/org/aspectj/weaver/patterns/SimpleScope.java

index 6d47044a6775a3432797107d5713c6833bd98c72..ec7779ba7abea4a28fd0226c9d8199673e7f4534 100644 (file)
@@ -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();
        }
index a5803489d25b1e3ed5d62abd215446fca2aea881..8b92cff0382af70a0428753a27a60b2fd1c33b56 100644 (file)
@@ -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);
 }
index 14aeb480708bc8d5ecdb5427ba827c676de277f1..e0e24f321e7f455610d7f3d79b98338380de5654 100644 (file)
@@ -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);
+       }
+
 }
index a58060bc1ca865414a051434e1ee5e79bea8c06d..19b161cce82537c004d1d46fc2cad70f807ace37 100644 (file)
@@ -132,6 +132,10 @@ public class SimpleScope implements IScope {
 
        }
        
+       public void message(IMessage aMessage) {
+               getMessageHandler().handleMessage(aMessage);
+       }
+       
        public World getWorld() {
                return world;
        }