-
Notifications
You must be signed in to change notification settings - Fork 90
NPE when using LTW cache #285
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
Comments
|
Due to code changes in #280 |
Thanks. I am taking this seriously, but will be very busy with work and intercontinental travel for a few days. So please, forgive me if I get to this later than I actually want to. (I hate regression bugs!) |
1.write SAME_BYTES to cacheMap when wovenbytes is null 2.fix TODO in SimpleCache#getAndInitialize, use Optional to help indicating case in which Hit cache but need to return null Signed-off-by: KimmingLau <[email protected]>
This reproduces regression bug #285 when running org.aspectj.systemtest.ajc171.NewFeatures::testSharedCache. Signed-off-by: Alexander Kriegisch <[email protected]>
This is an additional reproducer for regression bug #285. Signed-off-by: Alexander Kriegisch <[email protected]>
Also update lib/aspectj/aspectjweaver.jar to fix integration tests. Fixes #285. Signed-off-by: Alexander Kriegisch <[email protected]>
While fixing #285, I noticed that *.ajc171.NewFeatures was never executed as part of the AspectJ test suite, because since 2012 falsely *.ajc1610.NewFeatures was imported and executed a second time instead. In addition to an outdated AspetJ weaver library in 'lib', this was one more factor why the regression bug was never spotted. Signed-off-by: Alexander Kriegisch <[email protected]>
This is an additional reproducer for regression bug #285. Signed-off-by: Alexander Kriegisch <[email protected]>
Also update lib/aspectj/aspectjweaver.jar to fix integration tests. Fixes #285. Signed-off-by: Alexander Kriegisch <[email protected]>
Also update lib/aspectj/aspectjweaver.jar to fix integration tests. Fixes #285. Co-authored-by: Kimming Lau <[email protected]> Signed-off-by: Alexander Kriegisch <[email protected]>
This reproduces regression bug #285 when running org.aspectj.systemtest.ajc171.NewFeatures::testSharedCache. Signed-off-by: Alexander Kriegisch <[email protected]>
While fixing #285, I noticed that *.ajc171.NewFeatures was never executed as part of the AspectJ test suite, because since 2012 falsely *.ajc1610.NewFeatures was imported and executed a second time instead. In addition to an outdated AspetJ weaver library in 'lib', this was one more factor why the regression bug was never spotted. Signed-off-by: Alexander Kriegisch <[email protected]>
This is an additional reproducer for regression bug #285. Signed-off-by: Alexander Kriegisch <[email protected]>
Also update lib/aspectj/aspectjweaver.jar to fix integration tests. Fixes #285. Co-authored-by: Kimming Lau <[email protected]> Signed-off-by: Alexander Kriegisch <[email protected]>
@KimmingLau Can you please test <repositories>
<repository>
<id>ossrh-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories> |
Apreciate to do that, but actually I am confused that if |
You got a point there. My focus was to fix your problem, not to add an additional optimisation, given the fact that the problem solved was introduced in an optimisation step doing more than solving the problem you raised before about CDS archives. So, I was more conservative here. Your PR did not communicate its intent by additional tests for these cases, and my simple fix also did not break any existing tests. So I thought, it was enough. Your point seems to be that the weaver is triggered, even though maybe there are unwoven classes in the cache already, testing again if they need to be woven. Am I understanding you correctly here? Please explain the rationale in more detail. Thank you. |
Yes, that's my point. In the old version I feel like the behavior here seems to be different from before. Forgive me for not being very good at English and not being able to express what I mean very well. |
1. Write SAME_BYTES to cacheMap when woven bytes are null 2. Fix TODO in SimpleCache::getAndInitialize, using Optional to help indicate cache hit for unwoven class 3. Improve test coverage (cache miss, cache hit for unwoven class) Relates to #285. Co-authored-by: Alexander Kriegisch <[email protected]> Signed-off-by: KimmingLau <[email protected]> Signed-off-by: Alexander Kriegisch <[email protected]>
I cherry-picked your commits, squashed them into one and modified them a little bit, also adding more tests. See 1f1d429. Thanks for your valuable contribution and reviewing my own commit. |
Thanks for the review and approval, especially the additional testing code. It's my honor to contribute to such an excellent project. |
ltw-npe-reproducer.zip
step to reproduce:
unzip ltw-npe-reproducer.zip
mvn clean package
cd target; unzip ltw-npe-reproducer-1.0-SNAPSHOT-zip.zip
java -javaagent:aspectjweaver-1.9.21.1.jar -Daj.weaving.cache.enabled=true -Daj.weaving.cache.impl=shared -cp ltw-npe-reproducer-1.0-SNAPSHOT.jar com.foo.bar.Demo
The text was updated successfully, but these errors were encountered: