I'll send another PR later that cleans up the null checks. There was some ugliness left over from the old version actually, because the SparkContext constructor wants to call setMaster and setSparkHome and such but might pass null if the user hasn't provided those. But IMO setter methods should not ignore null values -- we should just disallow that, and maybe have some private methods that do the same thing if that makes initialization easier. I agree that the current version is super ugly.