Bug 120474 - Don't dump stack trace when loading $Proxy classes
Summary: Don't dump stack trace when loading $Proxy classes
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: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-12 20:24 EST by Ron Bodkin CLA
Modified: 2005-12-13 11:39 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2005-12-12 20:24:37 EST
I am seeing a BCException that gets caught and prints a stack trace in Aj.preProcess when loading a class named "$Proxy4"

This occurs in UnresolvedType.nameToSignature because the string it receives from ResolvedType.getDeclaringType is "" (i.e., it strips off the leading $, treating the type as if it were a nested type of nothing).

I'm not sure of the best resolution, but maybe the loop in ResolvedType should just say while (lastDollar > 0). This would handle the "leading $" case as an identifier rather than trying to look up the empty string. This might help with Hibernate's $$ types too...

Here is the stack when it happens:
UnresolvedType.nameToSignature(String) line: 774
UnresolvedType.forName(String) line: 309
ReferenceType(ResolvedType).getDeclaringType() line: 1255
WithinPointcut.isWithinType(ResolvedType) line: 50
WithinPointcut.fastMatch(FastMatchInfo) line: 67
AndPointcut.fastMatch(FastMatchInfo) line: 51
AndPointcut.fastMatch(FastMatchInfo) line: 51
AndPointcut.fastMatch(FastMatchInfo) line: 51
AndPointcut.fastMatch(FastMatchInfo) line: 51
AndPointcut.fastMatch(FastMatchInfo) line: 51
BcelWeaver.fastMatch(List, ResolvedType) line: 1635
BcelWeaver.weave(UnwovenClassFile, BcelObjectType, boolean) line: 1516
BcelWeaver.weaveWithoutDump(UnwovenClassFile, BcelObjectType) line: 1494
BcelWeaver.weaveAndNotify(UnwovenClassFile, BcelObjectType, IWeaveRequestor) line: 1275
BcelWeaver.weave(IClassFileProvider) line: 1097
ClassLoaderWeavingAdaptor(WeavingAdaptor).getWovenBytes(String, byte[]) line: 261
ClassLoaderWeavingAdaptor(WeavingAdaptor).weaveClass(String, byte[]) line: 194
Aj.preProcess(String, byte[], ClassLoader) line: 65
Comment 1 Andrew Clement CLA 2005-12-13 03:08:55 EST
I'm happy with the proposed fix if it gets through the test suite - i'm trying it now.
Comment 2 Matthew Webster CLA 2005-12-13 04:20:23 EST
Ron,

It would be helpful if you stated what the _actual_ problem was, preferably in the summary, and attaching a simple testcase. I added a test to the harness (for bug 117854) that uses proxies which could be amended if we knew what you were doing when the failure occured. Dumping a stack trace is not the problem. In fact (ironically) if we didn't you would not have noticed the problem or been able to report it. If I was raising this bug the summary would be "BCException weaving Java proxy classes under LTW".
Comment 3 Ron Bodkin CLA 2005-12-13 10:35:04 EST
I actually found out about the problem by seeing the BCException in the debugger and noticed that it caused weaving to abort. I can report it as a BCException if that's more helpful.
Comment 4 Andrew Clement CLA 2005-12-13 11:39:47 EST
fix available.