Ibotta/gradle-aspectj-pipeline-plugin

beakpoint not working in some folder name

sdes5317 opened this issue · 5 comments

I'm using android stuido debug mode, and found some case that breakpoint not working.
in my sample,i add a breakpoint in InjectSample.java line 14.
when the file in folder name "OneFolder", breakpoint not working, but seen inject is success(Log.e("test","test success") has been invoke).
if i move files(InjectSample.java,InjectSpan.java,JavaTargetExample.java) to folder name "OneFo", breakpoint is working well

Here is the sample

This sounds more like an IDE issue, but I'd like to help try to reproduce it anyway. I pulled down your sample code but did not see a file named InjectSample.java.

I used the sample-java project we provide to try and reproduce it instead. I moved the JavaAspect.java and JavaTargetExample.java to a subpackage named OneFolder. I then tried to hit a breakpoint, which worked:
Screen Shot 2022-04-25 at 8 45 47 AM

Next, I renamed the subpackage to OneFo, and tried to hit the breakpoint again. Again it worked:
Screen Shot 2022-04-25 at 8 46 25 AM

Maybe you can try to reproduce the issue using our sample-java project?

InjectSample.java. is in the branch FolderNameBug
I have tried in other computer(both ide version are the last), and OneFolder breakpoint is working, but when I changed the folder to a long name like "asdasdfg34243cz", it's not working again.
I think the bug is different in other computer.
maybe is IDE issue.

I will try to use sample-java to do again later

Hi ,I have fork this project, and do a Sample in sample-java.
I have add method injectTest by @Around annotation in JavaAspect.java, and then add breakpoint in line 25.
It's seen breakpoint not working, and I have tried in two computer with same situation

How bizarre!! Thanks for the sample app. That allowed me to reproduce it. Unfortunately, I don't believe there is anything we can do to fix it.

I did some research and it sounds like the reason this happens is because the entire method is replaced in bytecode by a synthetic method. This seems to be a quirk of both AspectJ and IDEs. Here are some links to people discussing this issue:

https://youtrack.jetbrains.com/issue/IDEA-142437
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206156169-AspectJ-Why-Don-t-Around-JoinPoint-Breakpoints-Get-Hit-
https://www.google.com/search?q=aspectj+%40around+breakpoint&rlz=1C5GCEM_enUS945US945&oq=aspectj+%40around+breakpoint&aqs=chrome..69i57.7410j0j7&sourceid=chrome&ie=UTF-8

thx!
It's Confusing, but seen the inject is working well.
I will closed the issue.