Handle String id correctly in Location assertId.

The current implementation of assertId in Location.java raises an assertion when a location id is a string, which is an acceptable case.

This commit fixes the issue by catching a NumberFormatException when calling Integer.ParseInt(id).

Thanks for merging if you think this is a good fix.