Bläddra i källkod

test and fix for pr101606, unused privated method warnings incorrectly generated for pointcuts

tags/preDefaultReweavable
acolyer 19 år sedan
förälder
incheckning
2c88c598b9

+ 5
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java Visa fil

@@ -407,4 +407,9 @@ public class AjProblemReporter extends ProblemReporter {
super.unusedPrivateType(typeDecl);
}

public void unusedPrivateMethod(AbstractMethodDeclaration methodDecl) {
// don't output unused warnings for pointcuts...
if (!(methodDecl instanceof PointcutDeclaration))
super.unusedPrivateMethod(methodDecl);
}
}

+ 5
- 0
tests/bugs150/pr101606.aj Visa fil

@@ -0,0 +1,5 @@
public aspect pr101606 {
private pointcut foo();
}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java Visa fil

@@ -378,6 +378,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("synchronized itd interface methods");
}
public void testNoWarningOnUnusedPointcut() {
runTest("unused private pointcuts");
}
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {

+ 6
- 1
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml Visa fil

@@ -468,7 +468,12 @@
</compile>
<run class="SynchronizedInterfaceMethods"/>
</ajc-test>

<ajc-test dir="bugs150" pr="101606" title="unused private pointcuts">
<compile files="pr101606.aj" options="-warn:unusedPrivate">
</compile>
</ajc-test>
<!-- ============================================================================ -->
<!-- ============================================================================ -->

Laddar…
Avbryt
Spara