aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java4
-rw-r--r--tests/bugs150/pr111481.aj14
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml10
4 files changed, 30 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java
index 0f0cf78b2..80e77e262 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java
@@ -232,7 +232,9 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration {
ResolvedMember signature = world.makeResolvedMember(binding,onTypeBinding);
signature.resetKind(Member.CONSTRUCTOR);
signature.resetName("<init>");
- signature.resetModifiers(declaredModifiers);
+ int resetModifiers = declaredModifiers;
+ if (binding.isVarargs()) resetModifiers = resetModifiers | Constants.ACC_VARARGS;
+ signature.resetModifiers(resetModifiers);
ResolvedMember syntheticInterMember =
AjcMemberMaker.interConstructor(declaringTypeX, signature, aspectType);
diff --git a/tests/bugs150/pr111481.aj b/tests/bugs150/pr111481.aj
new file mode 100644
index 000000000..e764b4e4f
--- /dev/null
+++ b/tests/bugs150/pr111481.aj
@@ -0,0 +1,14 @@
+public class pr111481 {
+
+ public static void main(String []argv) {
+ new pr111481(new Object[]{"a","b","c"});
+ new pr111481("a","b","c");
+ }
+
+}
+aspect A {
+ public pr111481.new(Object... names) {
+ System.out.println(names[0]);
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index daa404fab..54b89ff45 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -596,6 +596,9 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
assertNotNull("Couldn't find 'method-call(void pack.Test.someMethod())' element in the tree",pe);
}
+ public void testVarArgsIITDInConstructor() {
+ runTest("ITD varargs in constructor");
+ }
// helper methods.....
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 3c0335717..539df7b7d 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -4914,4 +4914,14 @@
<compile files="pr102357.aj"/>
<run class="pr102357"/>
</ajc-test>
+
+ <ajc-test dir="bugs150" title="ITD varargs in constructor">
+ <compile files="pr111481.aj" options="-1.5"/>
+ <run class="pr111481">
+ <stdout>
+ <line text="a"/>
+ <line text="a"/>
+ </stdout>
+ </run>
+ </ajc-test>
</suite> \ No newline at end of file