'path' is never used - no need to calculate it.

(cherry picked from commit 4578aee706417ad6bd59f5839e4df9d38e2adde9)
Use StringBuilder instead of StringBuffer. There is no need to synchronize.

(cherry picked from commit 0f0960d07e0938145e300694ea3799cd8c316c48)
Null safe equality checks

(cherry picked from commit 8506d03b1f204cdb3d6c2021fc6595f6c22b498e)
Reuse already calculated results

(cherry picked from commit 6af92c2e0d1d45c34dbd9f3e643601b2b00be34a)
Do not append the query if there is no such.
Otherwise it appends 'null' at the end.
Merge pull request #203 from martin-g/uri-utils

Minor improvements in URIUtils