Issue Details (XML | Word | Printable)

Key: GROOVY-1943
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Jochen Theodorou
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

ClassCastException for Reflector

Created: 15/Jun/07 05:55 AM   Updated: 15/Jun/07 05:58 AM
Component/s: None
Affects Version/s: 1.1-beta-1
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified


 Description  « Hide
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.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jochen Theodorou added a comment - 15/Jun/07 05:58 AM
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.