[
https://issues.jboss.org/browse/FORGE-779?page=com.atlassian.jira.plugin....
]
George Gastaldi updated FORGE-779:
----------------------------------
Workaround Description:
The following method in ForgeWizard was created to temporarily workaround the issue:
{code}
private <T> Class<T> locateNativeClass(Class<T> type) {
Class<T> result = type;
AddonRegistry registry = ForgeService.INSTANCE.getAddonRegistry();
for (Addon addon : registry.getRegisteredAddons()) {
try {
ClassLoader classLoader = addon.getClassLoader();
result = (Class<T>) classLoader.loadClass(type.getName());
break;
} catch (ClassNotFoundException e) {
}
}
return result;
}
{code}
was:
The following method in ForgeWizard was created to temporarily workaround the issue:
{code}
private <T> Class<T> locateNativeClass(Class<T> type) {
Class<T> result = type;
AddonRegistry registry = ForgeService.INSTANCE.getAddonRegistry();
for (Addon addon : registry.getRegisteredAddons()) {
try {
ClassLoader classLoader = addon.getClassLoader();
result = (Class<T>) classLoader.loadClass(type.getName());
break;
} catch (ClassNotFoundException e) {
}
}
return result;
}
{code}
Class parameters are not correctly loaded for the consuming
addon's classloader
-------------------------------------------------------------------------------
Key: FORGE-779
URL:
https://issues.jboss.org/browse/FORGE-779
Project: Forge
Issue Type: Bug
Reporter: George Gastaldi
Priority: Critical
Fix For: 2.0.0.Alpha1
Having the following scenario:
Eclipse plugin -> calls ConverterFactory -> passes Resource.class as a parameter
{code:java}
ConverterFactory.getConverter(File.class, Resource.class)
{code}
in ResourceConverterGenerator (resources addon):
{code:java}
@Override
public boolean handles(Class<?> source, Class<?> target)
{
return Resource.class.isAssignableFrom(target);
}
{code}
Returns false, because the classloader that loaded the Resource class is the Eclipse
classloader, not the Resource addon classloader AND Resource.class is not visible in the
convert addon.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira