--- /dev/null
+public interface Authorization {
+ boolean mayPerform(String user, String action);
+}
+
--- /dev/null
+public interface AuthorizationAdmin extends Authorization {
+ boolean mayPerform2(String user, String action);
+}
+
--- /dev/null
+public class AuthorizationImpl implements AuthorizationAdmin {
+
+ /* ========== interface Authorization ============*/
+
+ public boolean mayPerform(String user, String action) {
+ System.out.println("mayPerform() executing");
+ return true;
+ }
+
+ /* ========== interface AuthorizationAdmin ============*/
+
+ public boolean mayPerform2(String user, String action) {
+ System.out.println("mayPerform2() executing");
+ return true;
+ }
+
+}
+
--- /dev/null
+import org.aspectj.lang.reflect.*;
+import java.lang.reflect.*;
+
+public aspect CallAndMethodSignatureAspect {
+
+ pointcut callAnyPublicMethodInAuthorization() : call(public * Authorization+.*(..) );
+
+ Object around() : callAnyPublicMethodInAuthorization() {
+
+ MethodSignature methodSignature = (MethodSignature) thisJoinPoint.getSignature();
+
+ // returns NULL when calling a method defined in the top interface "Authorization"
+ Method method = methodSignature.getMethod();
+
+ System.out.println(method);
+ System.out.println(methodSignature.toLongString());
+
+ return proceed();
+ }
+}
+
--- /dev/null
+public class CallTest {
+
+
+ public static void main(String[]argv) {
+ new CallTest().testMayPerform();
+ new CallTest().testMayPerform2();
+ new CallTest().testMayPerform3();
+ }
+
+ private AuthorizationAdmin admin;
+ private Authorization auth;
+
+ public void testMayPerform() {
+ admin = new AuthorizationImpl();
+ boolean bool = admin.mayPerform("peter", "query");
+ if (!bool) throw new RuntimeException();
+ }
+
+ public void testMayPerform2() {
+ admin = new AuthorizationImpl();
+
+ boolean bool = admin.mayPerform2("peter2", "query2");
+ if (!bool) throw new RuntimeException();
+
+ }
+
+ public void testMayPerform3() {
+ auth = new AuthorizationImpl();
+
+ boolean bool = auth.mayPerform("peter2", "query2");
+
+ if (!bool) throw new RuntimeException();
+ }
+
+}
+
public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testGetMethodNull_pr154427() {
+ runTest("getMethod returning null");
+ }
+
public void testFQType_pr256937() {
runTest("fully qualified return type");
IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy();
<suite>
+ <ajc-test dir="bugs163/pr154427" title="getMethod returning null">
+ <compile files="AuthorizationImpl.java Authorization.java AuthorizationAdmin.java CallAndMethodSignatureAspect.java CallTest.java" options=""/>
+ <run class="CallTest">
+ <stdout>
+ <line text="public abstract boolean Authorization.mayPerform(java.lang.String,java.lang.String)"/>
+ <line text="public abstract interface boolean AuthorizationAdmin.mayPerform(java.lang.String, java.lang.String)"/>
+ <line text="mayPerform() executing"/>
+ <line text="public abstract boolean AuthorizationAdmin.mayPerform2(java.lang.String,java.lang.String)"/>
+ <line text="public abstract interface boolean AuthorizationAdmin.mayPerform2(java.lang.String, java.lang.String)"/>
+ <line text="mayPerform2() executing"/>
+ <line text="public abstract boolean Authorization.mayPerform(java.lang.String,java.lang.String)"/>
+ <line text="public abstract interface boolean Authorization.mayPerform(java.lang.String, java.lang.String)"/>
+ <line text="mayPerform() executing"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs163/pr256937" title="fully qualified return type">
<compile files="Ship.java ShipAccessor.java" options="-emacssym -1.5"/>
</ajc-test>