Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta-1
-
Fix Version/s: 1.1-beta-2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
If a reflector is generated for a class that is not loaded through RootLoader or by any other class loader which is a parent to the class loader which loaded the groovy runtime, then the generation of the reflector might fail with a ClassCastException. This happens only if the parent class loader also knows the Reflector class. The cast then fails because Reflector got duplicated.
I changed ReflectorLoader to resolve Reflector to the right Reflector class during a class definition (and its resolving) and only during that. I hope this avoids these nasty problems with the class duplication. It might be possible that it still fails, it is especially not possible to define a Reflector for a duplicate Reflector class, but I hope these cases are rare enough to nether manifest for the users.