eugenp / tutorials

Just Announced - "Learn Spring Security OAuth":

Home Page:http://bit.ly/github-lsso

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Escaping special characters is not null safe

samuelstein opened this issue · comments

The escaping method for special characters is not null safe.

I'm not very happy how this was fixed because it throws an exception for empty properties instead of returning empty string. This leads to unnecessary exception handling code outside the function and makes it more complicated to understand. I guess that in most cases you would anyway use an empty string when an exception was thrown.

Hey, @samuelstein.

Thanks for the feedback.

While your comment makes sense, considering the focus of the article and the fact that there is no clear-cut answer on handling nullable parameters. One should be able to easily adapt the code to its needs.