@@ -0,0 +1,35 @@ | |||
package test; | |||
public class VerifyErrorOnSet { | |||
class Node { | |||
int value; | |||
Node(int v) | |||
{ | |||
value = v; | |||
} | |||
} | |||
public VerifyErrorOnSet() | |||
{ | |||
new Node(1); | |||
} | |||
public static void main(String[] args) { | |||
VerifyErrorOnSet l = new VerifyErrorOnSet(); | |||
} | |||
} | |||
aspect ListAspect { | |||
pointcut setField(Object t) : target(t) && set(* VerifyErrorOnSet.Node+.*); | |||
before(Object t) : setField(t) { | |||
System.out.println("WRITE"); | |||
// Do something with t... | |||
} | |||
} |
@@ -409,6 +409,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
public void testNoUnusedParameterWarningsForSyntheticAdviceArgs() { | |||
runTest("no unused parameter warnings for synthetic advice args"); | |||
} | |||
public void testNoVerifyErrorWithSetOnInnerType() { | |||
runTest("no verify error with set on inner type"); | |||
} | |||
// helper methods..... | |||
public SyntheticRepository createRepos(File cpentry) { |
@@ -522,6 +522,14 @@ | |||
<compile files="pr109042.aj" options="-warn:+unusedArgument -warn:+unusedPrivate -warn:+unusedImport -1.5"> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="bugs150" pr="109124" title="no verify error with set on inner type"> | |||
<compile files="VerifyErrorOnSet.aj" options="-1.5" > | |||
</compile> | |||
<run class="test.VerifyErrorOnSet"/> | |||
</ajc-test> | |||
<!-- ============================================================================ --> | |||
<!-- ============================================================================ --> | |||
@@ -34,6 +34,8 @@ import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.GenericSigna | |||
final class BcelField extends ResolvedMemberImpl { | |||
private static int AccSynthetic = 0x1000; | |||
private Field field; | |||
private boolean isAjSynthetic; | |||
private boolean isSynthetic = false; | |||
@@ -78,6 +80,12 @@ final class BcelField extends ResolvedMemberImpl { | |||
for (int i = attrs.length - 1; i >= 0; i--) { | |||
if (attrs[i] instanceof Synthetic) isSynthetic = true; | |||
} | |||
// in 1.5, synthetic is a modifier, not an attribute | |||
if ((field.getModifiers() & AccSynthetic) != 0) { | |||
isSynthetic = true; | |||
} | |||
} | |||