Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-classloader weaving cache fails for classes generated for around advice types #315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tests/features171/pr386341/X.aj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
*
* Contributors:
* Andy Clement - Repro test case
* Andy Clement - repro test case
* Abraham Nevado
* Alexander Kriegisch - repro for GitHub 314
*******************************************************************************/

aspect X {
after(): execution(* *.*()) {
System.out.println("It Worked-after");
}

before(): execution(* *.*()) {
System.out.println("It Worked-before");
System.out.println("It Worked-before");
}

// Around advice reproduces GitHub 314 in connection with per-classloader cache
Object around(): execution(* *.*()) {
System.out.println("It Worked-around");
return proceed();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,65 @@

<!-- AspectJ v1.7.1 Features Tests -->
<suite>

<ajc-test dir="features171/pr386341" title="Test Shared Cache">
<compile files="A.java" options="-1.5"/>
<compile files="X.aj" options="-1.5 -Xlint:ignore" />
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=shared" >
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-after"/>
</stdout>
<compile files="X.aj" options="-1.5 -Xlint:ignore"/>
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=shared">
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-around"/>
<line text="It Worked-after"/>
</stdout>
</run>
<!-- Repeat run to actually re-use the cached files, reproducing GitHub issue 314 -->
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=shared">
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-around"/>
<line text="It Worked-after"/>
</stdout>
</run>
</ajc-test>
<ajc-test dir="features171/pr386341" title="Test Per ClassLoader Cache">
</ajc-test>

<ajc-test dir="features171/pr386341" title="Test Per ClassLoader Cache">
<compile files="A.java" options="-1.5"/>
<compile files="X.aj" options="-1.5 -Xlint:ignore" />
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=perloader" >
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-after"/>
</stdout>
<compile files="X.aj" options="-1.5 -Xlint:ignore"/>
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=perloader">
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-around"/>
<line text="It Worked-after"/>
</stdout>
</run>
<!-- Repeat run to actually re-use the cached files, reproducing GitHub issue 314 -->
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=perloader">
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-around"/>
<line text="It Worked-after"/>
</stdout>
</run>
</ajc-test>
</ajc-test>

<ajc-test dir="features171/pr386341" title="Test Default Cache Per ClassLoader">
<compile files="A.java" options="-1.5"/>
<compile files="X.aj" options="-1.5 -Xlint:ignore" />
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./" >
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-after"/>
</stdout>
<compile files="X.aj" options="-1.5 -Xlint:ignore"/>
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./">
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-around"/>
<line text="It Worked-after"/>
</stdout>
</run>
<!-- Repeat run to actually re-use the cached files, reproducing GitHub issue 314 -->
<run class="A" ltw="aop.xml" usefullltw="true" vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./">
<stdout>
<line text="It Worked-before"/>
<line text="It Worked-around"/>
<line text="It Worked-after"/>
</stdout>
</run>
</ajc-test>




</suite>
</ajc-test>

</suite>
Loading