Bug 118616 - Type pattern matching incorrect for names containing $ (dollar)
Summary: Type pattern matching incorrect for names containing $ (dollar)
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-30 06:47 EST by Matthew Webster CLA
Modified: 2005-12-04 17:22 EST (History)
0 users

See Also:


Attachments
Testcase (6.83 KB, application/octet-stream)
2005-11-30 08:12 EST, Matthew Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Webster CLA 2005-11-30 06:47:25 EST
The $ (dollar) symbol is a valid character for a type name e.g. generated Java proxies are called $Proxy0 and CGLIB generates proxies like com.foo.Name$$EnhancerByCGLIB$$12345 (see bug 117854). However the pattern matching fails so com.foo.* won't match the CGLIB proxy but com.foo..* will. This maybe because the $ characters are being converted to . (dot).
Comment 1 Matthew Webster CLA 2005-11-30 08:12:23 EST
Created attachment 30860 [details]
Testcase

Shows aspect matching joinpoints in Test but not Test$$EnhancerByCGLIB$$12345
Comment 2 Adrian Colyer CLA 2005-11-30 15:31:17 EST
I'll look into this. As we discussed in the cafeteria, this is almost certainly because of our $->. conversion assuming inner types.
Comment 3 Adrian Colyer CLA 2005-12-02 02:02:32 EST
fix in tree, waiting on build.
Comment 4 Andrew Clement CLA 2005-12-02 07:00:25 EST
Adrian - your fix for this introduced the 1.5 api isMemberClass() into the reflection based delegate.  I've removed the api call but found I had to force the isNested() method that uses it to return 'true' (?!?!) in order for the tests to all pass.  I'm surprised a default return value of 'true' (indicating everything is nested...) is what is required - can you take a look??
Comment 5 Andrew Clement CLA 2005-12-02 08:20:43 EST
Build is through, but I still want Adrian to take a look ... (see previous comment)
Comment 6 Adrian Colyer CLA 2005-12-04 17:22:31 EST
Doh - sorry about the 1.5 API.... but the rest of what you observed makes sense. The "splitNames" routine used to always convert $ -> ., even when it shouldn't. With the change, it only does this for a nested type. Turns out that many routes into the world create resolved types with $s in their names for nested types. It is also the case that all of the PointcutExpression tests that would have been failing for you use nested types exclusively. So defaulting to "false" would cause failure for nested types, and be different from our previous (99.99% correct) behaviour. Defaulting to true means that we will always do the conversion - which might cause trouble for reflection based resolved types under 1.4 or lower with genuine dollars in their names - but that's a pretty small set and there's not much we can do about it!