--- /dev/null
+public class Driver {
+ public static void main(String[]argv) {
+ new A().mone();
+ new A().mtwo();
+ new A().mone();
+ new A().mtwo();
+ new A().mone();
+ new A().mtwo();
+ }
+}
+
+class A {
+ public void mone() {}
+ public void mtwo() {}
+}
+
+aspect X pertypewithin(*) {
+
+ int[] state = new int[5];
+
+ before(): execution(* A.*(..)) {
+ int id = thisJoinPointStaticPart.getId();
+ System.out.println("At "+thisJoinPoint.getSignature()+" id="+id+" state="+state[id]);
+ state[id]++;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc164;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ *
+ * @author Andy Clement
+ */
+public class JointpointIdTests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testCaseA() {
+ runTest("casea");
+ }
+
+ // --
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(JointpointIdTests.class);
+ }
+
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc164/joinpointid.xml");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <ajc-test dir="features164/joinpointid" title="casea">
+ <compile files="Driver.java" options="-1.5"/>
+ <run class="Driver">
+ <stdout>
+ <line text="At void A.mone() id=0 state=0"/>
+ <line text="At void A.mtwo() id=1 state=0"/>
+ <line text="At void A.mone() id=0 state=1"/>
+ <line text="At void A.mtwo() id=1 state=1"/>
+ <line text="At void A.mone() id=0 state=2"/>
+ <line text="At void A.mtwo() id=1 state=2"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+</suite>
\ No newline at end of file