fabric8io/fabric8 — pull request #770 by hekonsek (2014-02-23 21:27:33+00:00)
Title: [Process manager] InstallOptionsBuilder now gracefully handles nulls.

Hi,

In the most recent version of the Fabric users encounter NPE if `optionalDependencyPatterns` and `excludeDependencyFilterPatterns` options of the `process:install-jar` command are not specified at the command line. Described behavior occurs because Karaf command (`InstallJar`) passes null values instead of the empty arrays to the `InstallOptionsBuilder`.

I changed `InstallOptionsBuilder` so it now gracefully handles `null` values passed to the `optionalDependencyPatterns` and `excludeDependencyFilterPatterns` methods. If null values are passed to these builder methods, I set empty array on the builder.

I could solve this issue on the Karaf command level (`org.fusesource.process.manager.commands.InstallJar` class) or by null-checking in `JarInstaller` class, however I think that making `InstallOptionsBuilder` null-proof will be more beneficial, as would protect us from similar misuse of the builder API.

Cheers.