mono/mono — pull request #1175 by chriseldredge (2014-07-24 15:45:32+00:00)
Title: [System] Allow Uri.GetComponents on relative Uri for SerializationInfoString 

Fixes [#21571](https://bugzilla.xamarin.com/show_bug.cgi?id=21571).

First I went down the path of changing `Uri.get_Parser()` to create a default parser instance
when the uri is relative, but thought that may break behavior in other methods that access
the parser instance.

I ended up putting a special case directly into `Uri.GetComponents()` and changed `UriParser.Format()`
from private to internal static so I could reuse it. This code is a bit circular: Uri calls UriParser.Format wich calls methods on Uri to do the actual work.

There is probably a cleaner solution.

I think the only potential side effect outside of the intended change in behavior would be any evil code using reflection to invoke UriParser.Format and I think this is unlikely and not worth worrying about since any code doing this is inherently dangerous.

This change in released under the MIT license.