…gonomics. Additional tests provided.

Originally the branch should only add tests, but as it showed up, some corner 
cases were not handled (I think) still well.

I wanted to cover 3 cases: 
1. the user enables a module which is a fragment; which should imply enabling 
the host module as well. 2.  if the user enables the hosting module which just 
happens to have some fragments around, all those will be enabled and injected 
(if dependencies are satisfied)
3. if a fragment is enabled, but its host module is **already loaded and 
live**, the fragment cannot (reliably) join the constructed classloader. 
Exception should be thrown.

- I found a place in `AutoupdateCatalogParser` where the `needsRestart` 
condition is probably wrong: if the module is a fragment, then the restart is 
always needed. Maybe could be refined more in that the host module must be 
already installed & enabled.

- in original code, the fragments were registered at the start of 
`ModuleManager.enable`, so that `simulateEnable` would not report them. I 
changed that so `ModuleManager` collects fragment list immediately as fragment 
`Module` objects are created. Then it can always find all fragments for a 
module.


[ Full content available at: 
https://github.com/apache/incubator-netbeans/pull/847 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to