groovy

ClassCastException for Reflector

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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 :
    0

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.

Activity

Hide
blackdrag blackdrag added a comment -

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.

Show
blackdrag blackdrag added a comment - 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: