Bug 84572 - ClassCastException while continous weaving
Summary: ClassCastException while continous weaving
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5.0 M4   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-07 09:18 EST by Martin Theiss CLA
Modified: 2012-04-03 15:53 EDT (History)
0 users

See Also:


Attachments
addSourceObjectType checks the type before casting (1.20 KB, patch)
2005-02-07 09:19 EST, Martin Theiss CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Theiss CLA 2005-02-07 09:18:02 EST
Example:
class A extends B

class A is available in bytecode
class B will be loaded at a later time

when we weave class A the weaver complains about missing class. shouldn't be
very critical...
when weaving class B, which we get now (e.g. via a network classloader), after
the vm has tried to resolve class A, the weaver throws a ClassCastException in
BcelWorld:addSourceObjectType
Comment 1 Martin Theiss CLA 2005-02-07 09:19:10 EST
Created attachment 17716 [details]
addSourceObjectType checks the type before casting

proposed fix
Comment 2 Adrian Colyer CLA 2005-03-23 09:39:35 EST
for investigation in aj5m3
Comment 3 Andrew Clement CLA 2005-06-22 03:32:31 EDT
not generics, postponing ...
Comment 4 Andrew Clement CLA 2005-10-03 05:12:17 EDT
Sorry for not getting to look at this sooner.  It now turns out the patch is out
of date because of all the generics changes.  However, I'm quite nervous about
what the patch was doing - I wonder what *is* in the type map against that
signature if its not a ResolvedType.Name (this inner type has now been changed
to be called 'ReferenceType' in CVS).  It might be that whatever it is shouldn't
have been put into the typemap in the first place - and if thats the case i'd
rather fix that than just cope with a rogue entry in the map later on, which
might cause us other problems elsewhere...

Are you able to recreate this with a recent AspectJ?  If so, when the
classcastexception occurs, what is it trying to cast?
Comment 5 Andrew Clement CLA 2005-10-13 12:18:07 EDT
I managed to get a fix for this tested under bug 112243 - I've put in a fix to
stop the rogue entry getting into the typemap and also a guard to prevent us
blowing up with no useful info should anything funny like this happen again.

fix is available in latest AJ dev build.