[ 
https://issues.apache.org/jira/browse/FELIX-5573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15890395#comment-15890395
 ] 

Karl Pauls commented on FELIX-5573:
-----------------------------------

Ok, I can confirm that we do return null in this case. I created a test case 
that reproduces the issue. Luckily, the immediate fix seems easy. Basically, 
all we are missing is a check in BundleClassloader.loadClass for the class to 
be null and throw a CNFE in that case. This is consistent with both, 
bundle.loadClass and (more importantly) Classloader.loadClass API (I don't 
think any of the two really allow to return a null). 

Regarding FELIX-5570, I think it will now work as [~djencks] describes it above 
i.e., the attempt to get the WeavingHook from the service factory will cause a 
CNFE inside the service factory which will make it return null (or maybe an 
exception) which in turn, makes us ignore the weaving hook for this classload. 
It sounds like this should get us on par with equinox for the moment.

Granted, I think [~tjwatson] raised another question in FELIX-5570 namely, 
whether it would be possible to detect that the cycle was due to this special 
situation and resolve it without throwing any exception but I think that 
discussion can continue somewhere else. I'm going to rename this issue to 
reflect that it is about not return null in a cycle but rather throw an CNFE.

> Detect recursive class loads while invoking weaving hooks
> ---------------------------------------------------------
>
>                 Key: FELIX-5573
>                 URL: https://issues.apache.org/jira/browse/FELIX-5573
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-5.6.2
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>             Fix For: framework-5.6.4
>
>
> We need to detect recursive class loads while invoking weaving hooks, if 
> recursion is detected for a class name then we want to simply ignore all 
> weave hooks for the recursive class load and allow it to proceed to define 
> class.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to