Incorrect warning message on thread pool startup in full AOT:ed Windows build.
[mono.git] / mcs / class / System / System / UriBuilder.cs
index 412948431bfa78de6b5914850e5740f62a30c134..6d878731991f60945ebc74a77981c868acf44215 100644 (file)
@@ -74,10 +74,8 @@ namespace System
                
                public UriBuilder (Uri uri)
                {
-#if NET_4_0
                        if (uri == null)
                                throw new ArgumentNullException ("uri");
-#endif
                        Initialize (uri);
                }
                
@@ -230,7 +228,7 @@ namespace System
                        get {
                                if (!modified) 
                                        return uri;
-                               uri = new Uri (ToString (), true);
+                               uri = new Uri (ToString ());
                                // some properties are updated once the Uri is created - see unit tests
                                host = uri.Host;
                                path = uri.AbsolutePath;
@@ -265,7 +263,12 @@ namespace System
 
                        builder.Append (scheme);
                        // note: mailto and news use ':', not "://", as their delimiter
-                       builder.Append (Uri.GetSchemeDelimiter (scheme));
+                       if (UriParser.IsKnownScheme(scheme)) {
+                               builder.Append (Uri.GetSchemeDelimiter (scheme));
+                       }
+                       else {
+                               builder.Append (host.Length > 0 ? Uri.SchemeDelimiter : ":");
+                       }
 
                        if (username != String.Empty) {
                                builder.Append (username);
@@ -282,7 +285,8 @@ namespace System
 
                        if (path != String.Empty &&
                            builder [builder.Length - 1] != '/' &&
-                           path.Length > 0 && path [0] != '/')
+                           path.Length > 0 && path [0] != '/' &&
+                               host.Length > 0)
                                builder.Append ('/');
                        builder.Append (path);
                        builder.Append (query);