]> source.dussan.org Git - aspectj.git/commitdiff
246125: c15
authoraclement <aclement>
Tue, 21 Oct 2008 18:55:04 +0000 (18:55 +0000)
committeraclement <aclement>
Tue, 21 Oct 2008 18:55:04 +0000 (18:55 +0000)
weaver/src/org/aspectj/weaver/Shadow.java
weaver/src/org/aspectj/weaver/TemporaryTypeMunger.java [new file with mode: 0644]
weaver/src/org/aspectj/weaver/WeaverStateInfo.java
weaver/src/org/aspectj/weaver/patterns/PerCflow.java

index 778631d6379723cec5d518ed9cb4f7f796c8e7e0..edc8fd121013b36fe92f76a58a3fb23a038902b7 100644 (file)
@@ -24,7 +24,6 @@ import java.util.Set;
 import org.aspectj.bridge.IMessage;
 import org.aspectj.bridge.ISourceLocation;
 import org.aspectj.bridge.MessageUtil;
-import org.aspectj.lang.JoinPoint;
 import org.aspectj.util.PartialOrder;
 import org.aspectj.util.TypeSafeEnum;
 import org.aspectj.weaver.ast.Var;
@@ -272,22 +271,36 @@ public abstract class Shadow {
                return getResolvedSignature().getGenericReturnType();
        }
 
+       public static String METHOD_EXECUTION = "method-execution";
+       public static String METHOD_CALL = "method-call";
+       public static String CONSTRUCTOR_EXECUTION = "constructor-execution";
+       public static String CONSTRUCTOR_CALL = "constructor-call";
+       public static String FIELD_GET = "field-get";
+       public static String FIELD_SET = "field-set";
+       public static String STATICINITIALIZATION = "staticinitialization";
+       public static String PREINITIALIZATION = "preinitialization";
+       public static String INITIALIZATION = "initialization";
+       public static String EXCEPTION_HANDLER = "exception-handler";
+       public static String SYNCHRONIZATION_LOCK = "lock";
+       public static String SYNCHRONIZATION_UNLOCK = "unlock";
+       public static String ADVICE_EXECUTION = "adviceexecution";
+
        /**
         * These names are the ones that will be returned by thisJoinPoint.getKind() Those need to be documented somewhere
         */
-       public static final Kind MethodCall = new Kind(JoinPoint.METHOD_CALL, 1, true);
-       public static final Kind ConstructorCall = new Kind(JoinPoint.CONSTRUCTOR_CALL, 2, true);
-       public static final Kind MethodExecution = new Kind(JoinPoint.METHOD_EXECUTION, 3, false);
-       public static final Kind ConstructorExecution = new Kind(JoinPoint.CONSTRUCTOR_EXECUTION, 4, false);
-       public static final Kind FieldGet = new Kind(JoinPoint.FIELD_GET, 5, true);
-       public static final Kind FieldSet = new Kind(JoinPoint.FIELD_SET, 6, true);
-       public static final Kind StaticInitialization = new Kind(JoinPoint.STATICINITIALIZATION, 7, false);
-       public static final Kind PreInitialization = new Kind(JoinPoint.PREINITIALIZATION, 8, false);
-       public static final Kind AdviceExecution = new Kind(JoinPoint.ADVICE_EXECUTION, 9, false);
-       public static final Kind Initialization = new Kind(JoinPoint.INITIALIZATION, 10, false);
-       public static final Kind ExceptionHandler = new Kind(JoinPoint.EXCEPTION_HANDLER, 11, true);
-       public static final Kind SynchronizationLock = new Kind(JoinPoint.SYNCHRONIZATION_LOCK, 12, true);
-       public static final Kind SynchronizationUnlock = new Kind(JoinPoint.SYNCHRONIZATION_UNLOCK, 13, true);
+       public static final Kind MethodCall = new Kind(METHOD_CALL, 1, true);
+       public static final Kind ConstructorCall = new Kind(CONSTRUCTOR_CALL, 2, true);
+       public static final Kind MethodExecution = new Kind(METHOD_EXECUTION, 3, false);
+       public static final Kind ConstructorExecution = new Kind(CONSTRUCTOR_EXECUTION, 4, false);
+       public static final Kind FieldGet = new Kind(FIELD_GET, 5, true);
+       public static final Kind FieldSet = new Kind(FIELD_SET, 6, true);
+       public static final Kind StaticInitialization = new Kind(STATICINITIALIZATION, 7, false);
+       public static final Kind PreInitialization = new Kind(PREINITIALIZATION, 8, false);
+       public static final Kind AdviceExecution = new Kind(ADVICE_EXECUTION, 9, false);
+       public static final Kind Initialization = new Kind(INITIALIZATION, 10, false);
+       public static final Kind ExceptionHandler = new Kind(EXCEPTION_HANDLER, 11, true);
+       public static final Kind SynchronizationLock = new Kind(SYNCHRONIZATION_LOCK, 12, true);
+       public static final Kind SynchronizationUnlock = new Kind(SYNCHRONIZATION_UNLOCK, 13, true);
 
        // Bits here are 1<<(Kind.getKey()) - and unfortunately keys didn't start at zero so bits here start at 2
        public static final int MethodCallBit = 0x002;
diff --git a/weaver/src/org/aspectj/weaver/TemporaryTypeMunger.java b/weaver/src/org/aspectj/weaver/TemporaryTypeMunger.java
new file mode 100644 (file)
index 0000000..2d31b59
--- /dev/null
@@ -0,0 +1,35 @@
+/* *******************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Eclipse Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/epl-v10.html 
+ *  
+ * ******************************************************************/
+package org.aspectj.weaver;
+
+import java.util.Map;
+
+/**
+ * Some methods need a temporary type munger (because ConcreteTypeMunger is abstract - dont ask...).
+ * 
+ * TODO ought to remove the need for this or at least sort out the two methods that are in it, they look wierd...
+ * 
+ * @author AndyClement
+ */
+public class TemporaryTypeMunger extends ConcreteTypeMunger {
+
+       public TemporaryTypeMunger(ResolvedTypeMunger munger, ResolvedType aspectType) {
+               super(munger, aspectType);
+       }
+
+       public ConcreteTypeMunger parameterizeWith(Map parameterizationMap, World world) {
+               throw new UnsupportedOperationException("Cannot be called on a TemporaryTypeMunger");
+       }
+
+       public ConcreteTypeMunger parameterizedFor(ResolvedType targetType) {
+               throw new UnsupportedOperationException("Cannot be called on a TemporaryTypeMunger");
+       }
+
+}
\ No newline at end of file
index 08fa790046072eeb08b66be1277254ed488975b7..c1cca4567383474d03c655f9c6d7221e41a506b6 100644 (file)
@@ -28,7 +28,6 @@ import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
 import org.aspectj.bridge.IMessage;
-import org.aspectj.weaver.bcel.BcelTypeMunger;
 
 /**
  * WeaverStateInfo represents how a type was processed. It is used by the weaver to determine how a type was previously treated and
@@ -201,7 +200,7 @@ public class WeaverStateInfo {
                                continue;
                        }
 
-                       ret.add(new BcelTypeMunger(entry.typeMunger, aspectType));
+                       ret.add(new TemporaryTypeMunger(entry.typeMunger, aspectType));
                }
                return ret;
        }
index eae943afc87bfe5f6e678fcc61b4be47c5c6cb07..7cc0a242b0507be47b9c5fe3496dea7e3e859d93 100644 (file)
@@ -35,7 +35,6 @@ import org.aspectj.weaver.VersionedDataInputStream;
 import org.aspectj.weaver.World;
 import org.aspectj.weaver.ast.Expr;
 import org.aspectj.weaver.ast.Test;
-import org.aspectj.weaver.bcel.BcelAccessForInlineMunger;
 
 public class PerCflow extends PerClause {
        private final boolean isBelow;