Closed jackgene closed 9 years ago
Jack,
The filtering is done on the className in the form given by ClassFileTransformer.transform:
com/skybar/demo/LongLoopServlet$1
For performance reasons, this is done before any byte code parsing. So we don't know anything about the source file name when making this decision.
Also note that the code you changed in shouldInstrument was excluding class names containing "$$", that's a double $. So I don't think we were skipping inner classes at all.
In fact, the demo source has a LongLoopServlet with an anon inner class which is instrumented and counted just fine.
What do you think?
Jack,
This might just be me not knowing my way around Github, but wouldn't it be a tad easier if you made these changes in a branch on WinterTechForum/skybar? That way I would not have to clone your fork for testing and we could contribute together on the same branch.
This is the way @marshallpierce and I have been working and it just seems a bit easier.
Let me look into the inner class thing. It wasn't working for me for some reason.
As for just using branches on this repository, yup, that works for me, I can move my changes here as well.
Hey Eirik, I'm going to be on vacation next week, but here's what I found last week. I think I was trying to solve two problems with this:
Added support for inner classes by filtering out only source file names with '$' in them (which generally indicates generated sources), instead of filtering out any class name with '$' in them.
In other words, if a class name has '$' in it, but its source file does not have '$' in it, we want to instrument it.
Note that I tried updating tests to verify this case, but the testing framework wasn't quite handling inner classes correctly. I'll have a look at this later.