passing null to array arguments confuzes static join point signature.
--- /dev/null
+package dk.infimum.aspectjtest;
+public class Main {
+
+ public static void main(String[] args) {
+ Main obj = new Main();
+ //Main m[] = new Main[3];
+
+ // swap following lines to change behavior
+ obj.test(null, null);
+ obj.test(null, new Main[]{});
+ }
+
+ void test(Main dummy, Main[] dummy2) {}
+
+}
--- /dev/null
+package dk.infimum.aspectjtest;
+public class Main2 {
+
+ public static void main(String[] args) {
+ Main2 obj = new Main2();
+ // swap following lines to change behavior
+ obj.test(null, new Main2[]{});
+ obj.test(null, null);
+ }
+
+ void test(Main2 dummy, Main2[] dummy2) {}
+
+}
--- /dev/null
+import org.aspectj.lang.reflect.MethodSignature;
+
+public aspect MainAspect {
+
+ pointcut testcall(): execution(* test*(..));
+
+ before(): testcall() {
+ MethodSignature sig =
+ (MethodSignature) thisJoinPointStaticPart.getSignature();
+ System.out.println(sig);
+ Class[] params = sig.getParameterTypes();
+ for(int i=0;i<params.length;i++) {
+ Class cls = params[i];
+ String name = cls.getName();
+ System.out.println(" - " + name);
+ if (name.indexOf("ClassNotFoundException")!=-1) throw new RuntimeException("");
+ }
+ }
+}
public void test053_bogusMessage2() {
runTest("Bogus error message: The abstract method ajc$pointcut$$tracingScope$a2 in type Tracing can only be defined by an abstract class (2)");
}
+
+ public void test054_cnfe() {
+ runTest("passing null to array arguments confuzes static join point signature. (1)");
+ }
+
+ public void test055_cnfe() {
+ runTest("passing null to array arguments confuzes static join point signature. (2)");
+ }
+
}
<message kind="error" line="13" text="abstract intertype method declaration 'void PublicPackage.world()' on interface PublicPackage must be declared public (compiler limitation)"/>
</compile>
</ajc-test>
-
-
+
<ajc-test dir="bugs/pr72531" pr="72531"
title="declare warning warns at wrong points">
<compile files="de/rohith/HelloWorld.java,de/rohith/HelloWorldAspect.java,de/rohith/PrinterWorld.java">
<message kind="error" line="2" text="The abstract pointcut tracingScope can only be defined in an aspect"/>
</compile>
</ajc-test>
-
-
\ No newline at end of file
+
+ <ajc-test dir="bugs/pr70404" pr="70404"
+ title="passing null to array arguments confuzes static join point signature. (1)">
+ <compile files="Main.java,MainAspect.java"/>
+ <run class="dk.infimum.aspectjtest.Main"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/pr70404" pr="70404"
+ title="passing null to array arguments confuzes static join point signature. (2)">
+ <compile files="Main2.java,MainAspect.java"/>
+ <run class="dk.infimum.aspectjtest.Main2"/>
+ </ajc-test>