groovy

Allow to set ClassLoader explicitly for ProxyGenerator class

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.4
  • Fix Version/s: 1.5.5, 1.6-beta-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

ProxyGenerator uses classloader of base class (or classloader of one of interfaces) for proxy class loading.
There are several cases when this default behaviour is inappropriate.

For instance, in OSGI environment if you are trying to generate proxy for some class in bundle different from current bundle, using of base classes classloader leads to NoClassDefFoundError.

Sample code:
import org.eclipse.debug.core.model.*
([:] as LineBreakpoint)

this code throws exception:
java.lang.NoClassDefFoundError: groovy/lang/Script.

Of course, plugin of LineBreakpoint class (org.eclipse.debug.core)
does not know about groovy classes, so it can not find Script class.

In this case ability to set classloader explicitly will be very useful.

Full discussion can be found here:
http://groovy.markmail.org/message/hleawq7pedcowbhg

Activity

Hide
Paul King added a comment -

fixed in trunk and merged onto the 1.5.x branch

Show
Paul King added a comment - fixed in trunk and merged onto the 1.5.x branch

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: