In the spark style guide it says "Put curly braces even around one-line if, else or loop statements." So IMO this and the other instances of this are correct as-is.