This also fixes a bug. Previously, ResolvedType.equals was used for
equality check, and in there is a '==' comparison, which does not work
for two different ArrayReferenceType instances, even if the component
type is the same.
Relates to #246.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
return false;
}
}
+
+ @Override
+ public boolean equals(Object other) {
+ if (other instanceof ArrayReferenceType)
+ return componentType.equals(((ArrayReferenceType) other).componentType);
+ return super.equals(other);
+ }
+
}
public int App.foo(int parameter) {
return parameter + 3;
}
+
+ public void App.foo(String... parameters) { }
+
+ @Second
+ public int App.foo(int... parameters) {
+ int sum = 0;
+ for (int parameter : parameters)
+ sum += parameter;
+ return sum;
+ }
}
<compile files="First.java Second.java App.java ITDAspect.aj" options="-8"/>
<run class="App">
<stdout>
- <line text="[@First(), @Second()] public void App.foo(java.lang.Object)"/>
+ <line text="[@Second()] public int App.foo(int[])"/>
<line text="[@First()] public void App.foo(java.lang.String)"/>
+ <line text="[] public void App.foo(java.lang.String[])"/>
+ <line text="[@First(), @Second()] public void App.foo(java.lang.Object)"/>
<line text="[@Second()] public int App.foo(int)"/>
</stdout>
</run>