Community
Participate
Working Groups
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
I'm happy with the proposed fix if it gets through the test suite - i'm trying it now.
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".
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.
fix available.