Revision 2115e2a5 trunk/Pithos.Network/RestClient.cs

b/trunk/Pithos.Network/RestClient.cs
329 329

  
330 330
        public string GetHeaderValue(string headerName,bool optional=false)
331 331
        {
332
            if (this.ResponseHeaders==null)
333
                throw new InvalidOperationException("ResponseHeaders are null");
332
            Contract.Requires<InvalidOperationException>(ResponseHeaders!=null,"ResponseHeaders are null");
334 333
            Contract.EndContractBlock();
335 334

  
336 335
            var values=this.ResponseHeaders.GetValues(headerName);
......
478 477
        /// <param name="source">The RestClient from which the headers are copied</param>
479 478
        public void CopyHeaders(RestClient source)
480 479
        {
481
            if (source == null)
482
                throw new ArgumentNullException("source", "source can't be null");
480
            Contract.Requires<ArgumentNullException>(source!=null);
483 481
            Contract.EndContractBlock();
484 482
            //The Headers getter initializes the property, it is never null
485 483
            Contract.Assume(Headers!=null);
......
494 492
        /// <param name="target">The target collection to which the headers are copied</param>
495 493
        public static void CopyHeaders(WebHeaderCollection source,WebHeaderCollection target)
496 494
        {
497
            if (source == null)
495
            Contract.Requires<ArgumentNullException>(source != null);
496
            Contract.Requires<ArgumentNullException>(target != null);
498 497
                throw new ArgumentNullException("source", "source can't be null");
499 498
            if (target == null)
500 499
                throw new ArgumentNullException("target", "target can't be null");

Also available in: Unified diff