system\appdomain.cs (71)
391Contract.Assert(s_flags != 0);
498Contract.Assert(_domainManager == null, "_domainManager == null");
610Contract.Assert(!_compatFlagsInitialized);
635Contract.Assert(attrs.Length == 1);
825Contract.Assert(assembly != null, "assembly != null");
826Contract.Assert(type != null, "type != null");
885Contract.Requires(fullName != null, "fullName != null");
1036Contract.Requires(providedSecurityInfo != null);
1054Contract.Requires(activationContext != null);
1157Contract.Requires(args != null);
1175Contract.Requires(args != null);
1218Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1232Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1249Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1267Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1287Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1309Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1332Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1352Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1377Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1404Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1433Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1462Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1486Contract.Ensures(Contract.Result<AssemblyBuilder>() != null);
1561Contract.EndContractBlock();
1582Contract.EndContractBlock();
1607Contract.EndContractBlock();
1623Contract.EndContractBlock();
1644Contract.EndContractBlock();
1661Contract.EndContractBlock();
1685Contract.EndContractBlock();
1722Contract.EndContractBlock();
1746Contract.Assert(IsLegacyCasPolicyEnabled || securityAttributes == null);
1772Contract.EndContractBlock();
1806Contract.EndContractBlock();
1832Contract.Assert(IsLegacyCasPolicyEnabled || securityAttributes == null);
2106Contract.Ensures(Contract.Result<AppDomain>() != null);
2362Contract.EndContractBlock();
2478Contract.EndContractBlock();
2542Contract.Assert(false, "Need to handle new LoaderInformation value in AppDomain.GetData()");
2584Contract.EndContractBlock();
2609Contract.EndContractBlock();
2673Contract.EndContractBlock();
2713Contract.EndContractBlock();
2902Contract.Assert( !(obj is IPermission), "IPermission should be xml deserialized" );
2903Contract.Assert( !(obj is PermissionSet), "PermissionSet should be xml deserialized" );
3222Contract.Assert(_FusionStore != null,
3419Contract.EndContractBlock();
3467Contract.EndContractBlock();
3517Contract.Requires(info != null);
3729Contract.Requires(arg != null && arg is Object[]);
3730Contract.Requires(((Object[])arg).Length >= 8);
4210Contract.Assert(FusionStore.LoaderOptimization == LoaderOptimization.NotSpecified,
4471Contract.Assert(evidence != null);
4472Contract.Assert(IsHomogenous);
4473Contract.Assert(evidence.GetHostEvidence<GacInstalled>() == null);
4703Contract.Assert(i != -1, "invalid image location");
system\AppDomainSetup.cs (19)
216Contract.EndContractBlock();
221Contract.Assert(activationArguments.ActivationContext != null, "Cannot set base directory without activation context");
651Contract.EndContractBlock();
1339Contract.Assert('A' == ACTAG_APP_CONFIG_FILE[0] , "Assumption violated");
1340Contract.Assert('A' == ACTAG_APP_NAME[0] , "Assumption violated");
1341Contract.Assert('A' == ACTAG_APP_BASE_URL[0] , "Assumption violated");
1342Contract.Assert('B' == ACTAG_BINPATH_PROBE_ONLY[0] , "Assumption violated");
1343Contract.Assert('C' == ACTAG_APP_CACHE_BASE[0] , "Assumption violated");
1344Contract.Assert('D' == ACTAG_DEV_PATH[0] , "Assumption violated");
1345Contract.Assert('D' == ACTAG_APP_DYNAMIC_BASE[0] , "Assumption violated");
1346Contract.Assert('F' == ACTAG_FORCE_CACHE_INSTALL[0] , "Assumption violated");
1347Contract.Assert('L' == LICENSE_FILE[0] , "Assumption violated");
1348Contract.Assert('P' == ACTAG_APP_PRIVATE_BINPATH[0] , "Assumption violated");
1349Contract.Assert('S' == ACTAG_APP_SHADOW_COPY_DIRS[0], "Assumption violated");
1350Contract.Assert('D' == ACTAG_DISALLOW_APPLYPUBLISHERPOLICY[0], "Assumption violated");
1351Contract.Assert('C' == ACTAG_CODE_DOWNLOAD_DISABLED[0], "Assumption violated");
1352Contract.Assert('D' == ACTAG_DISALLOW_APP_BINDING_REDIRECTS[0], "Assumption violated");
1353Contract.Assert('D' == ACTAG_DISALLOW_APP_BASE_PROBING[0], "Assumption violated");
1354Contract.Assert('A' == ACTAG_APP_CONFIG_BLOB[0], "Assumption violated");
system\collections\generic\arraysorthelper.cs (154)
130Contract.Assert(keys != null, "Check the arguments in the caller!");
131Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
190Contract.Requires(array != null, "Check the arguments in the caller!");
191Contract.Requires(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
263Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
295Contract.Requires(keys != null);
296Contract.Requires(comparer != null);
297Contract.Requires(left >= 0);
298Contract.Requires(length >= 0);
299Contract.Requires(length <= keys.Length);
300Contract.Requires(length + left <= keys.Length);
310Contract.Requires(keys != null);
311Contract.Requires(comparer != null);
312Contract.Requires(lo >= 0);
313Contract.Requires(hi < keys.Length);
357Contract.Requires(keys != null);
358Contract.Requires(comparer != null);
359Contract.Requires(lo >= 0);
360Contract.Requires(hi > lo);
361Contract.Requires(hi < keys.Length);
362Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
394Contract.Requires(keys != null);
395Contract.Requires(comparer != null);
396Contract.Requires(lo >= 0);
397Contract.Requires(hi > lo);
398Contract.Requires(hi < keys.Length);
414Contract.Requires(keys != null);
415Contract.Requires(comparer != null);
416Contract.Requires(lo >= 0);
417Contract.Requires(lo < keys.Length);
438Contract.Requires(keys != null);
439Contract.Requires(lo >= 0);
440Contract.Requires(hi >= lo);
441Contract.Requires(hi <= keys.Length);
470Contract.Assert(keys != null, "Check the arguments in the caller!");
471Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
535Contract.Assert(array != null, "Check the arguments in the caller!");
536Contract.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
597Contract.Requires(keys != null);
598Contract.Requires(0 <= a && a < keys.Length);
599Contract.Requires(0 <= b && b < keys.Length);
624Contract.Requires(keys != null);
625Contract.Requires(0 <= left && left < keys.Length);
626Contract.Requires(0 <= right && right < keys.Length);
664Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
696Contract.Requires(keys != null);
697Contract.Requires(left >= 0);
698Contract.Requires(length >= 0);
699Contract.Requires(length <= keys.Length);
700Contract.Requires(length + left <= keys.Length);
710Contract.Requires(keys != null);
711Contract.Requires(lo >= 0);
712Contract.Requires(hi < keys.Length);
756Contract.Requires(keys != null);
757Contract.Requires(lo >= 0);
758Contract.Requires(hi > lo);
759Contract.Requires(hi < keys.Length);
760Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
800Contract.Requires(keys != null);
801Contract.Requires(lo >= 0);
802Contract.Requires(hi > lo);
803Contract.Requires(hi < keys.Length);
819Contract.Requires(keys != null);
820Contract.Requires(lo >= 0);
821Contract.Requires(lo < keys.Length);
842Contract.Requires(keys != null);
843Contract.Requires(lo >= 0);
844Contract.Requires(hi >= lo);
845Contract.Requires(hi <= keys.Length);
906Contract.Assert(keys != null, "Check the arguments in the caller!"); // Precondition on interface method
907Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
947Contract.Requires(keys != null);
948Contract.Requires(values == null || values.Length >= keys.Length);
949Contract.Requires(comparer != null);
950Contract.Requires(0 <= a && a < keys.Length);
951Contract.Requires(0 <= b && b < keys.Length);
1012Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
1050Contract.Requires(keys != null);
1051Contract.Requires(values != null);
1052Contract.Requires(comparer != null);
1053Contract.Requires(left >= 0);
1054Contract.Requires(length >= 0);
1055Contract.Requires(length <= keys.Length);
1056Contract.Requires(length + left <= keys.Length);
1057Contract.Requires(length + left <= values.Length);
1067Contract.Requires(keys != null);
1068Contract.Requires(values != null);
1069Contract.Requires(comparer != null);
1070Contract.Requires(lo >= 0);
1071Contract.Requires(hi < keys.Length);
1115Contract.Requires(keys != null);
1116Contract.Requires(values != null);
1117Contract.Requires(comparer != null);
1118Contract.Requires(lo >= 0);
1119Contract.Requires(hi > lo);
1120Contract.Requires(hi < keys.Length);
1121Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
1153Contract.Requires(keys != null);
1154Contract.Requires(values != null);
1155Contract.Requires(comparer != null);
1156Contract.Requires(lo >= 0);
1157Contract.Requires(hi > lo);
1158Contract.Requires(hi < keys.Length);
1174Contract.Requires(keys != null);
1175Contract.Requires(comparer != null);
1176Contract.Requires(lo >= 0);
1177Contract.Requires(lo < keys.Length);
1203Contract.Requires(keys != null);
1204Contract.Requires(values != null);
1205Contract.Requires(comparer != null);
1206Contract.Requires(lo >= 0);
1207Contract.Requires(hi >= lo);
1208Contract.Requires(hi <= keys.Length);
1238Contract.Assert(keys != null, "Check the arguments in the caller!");
1239Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
1369Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
1407Contract.Requires(keys != null);
1408Contract.Requires(values != null);
1409Contract.Requires(left >= 0);
1410Contract.Requires(length >= 0);
1411Contract.Requires(length <= keys.Length);
1412Contract.Requires(length + left <= keys.Length);
1413Contract.Requires(length + left <= values.Length);
1423Contract.Requires(keys != null);
1424Contract.Requires(values != null);
1425Contract.Requires(lo >= 0);
1426Contract.Requires(hi < keys.Length);
1470Contract.Requires(keys != null);
1471Contract.Requires(values != null);
1472Contract.Requires(lo >= 0);
1473Contract.Requires(hi > lo);
1474Contract.Requires(hi < keys.Length);
1475Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
1515Contract.Requires(keys != null);
1516Contract.Requires(values != null);
1517Contract.Requires(lo >= 0);
1518Contract.Requires(hi > lo);
1519Contract.Requires(hi < keys.Length);
1535Contract.Requires(keys != null);
1536Contract.Requires(lo >= 0);
1537Contract.Requires(lo < keys.Length);
1563Contract.Requires(keys != null);
1564Contract.Requires(values != null);
1565Contract.Requires(lo >= 0);
1566Contract.Requires(hi >= lo);
1567Contract.Requires(hi <= keys.Length);
system\collections\hashtable.cs (33)
277Contract.EndContractBlock();
293Contract.Assert( loadsize < hashsize, "Invalid hashtable loadsize!");
379Contract.EndContractBlock();
389Contract.EndContractBlock();
447Contract.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized.");
506Contract.EndContractBlock();
559Contract.Requires(array != null);
560Contract.Requires(array.Rank == 1);
575Contract.Requires(array != null);
576Contract.Requires(array.Rank == 1);
600Contract.EndContractBlock();
628Contract.Requires(array != null);
629Contract.Requires(array.Rank == 1);
648Contract.EndContractBlock();
771Contract.Assert(loadsize < newsize, "Our current implementaion means this is not possible.");
823Contract.Assert(key != null, "key can't be null here!");
880Contract.EndContractBlock();
1041Contract.Assert(false, "hash table insert failed! Load factor too high, or our double hashing function is incorrect.");
1047Contract.Assert(hashcode >= 0, "hashcode >= 0"); // make sure collision bit (sign bit) wasn't set.
1078Contract.EndContractBlock();
1079Contract.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized.");
1142Contract.EndContractBlock();
1155Contract.EndContractBlock();
1314Contract.EndContractBlock();
1355Contract.EndContractBlock();
1411Contract.EndContractBlock();
1470Contract.EndContractBlock();
1639Contract.EndContractBlock();
1721Contract.EndContractBlock();
1753Contract.Assert( MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength");
1772Contract.Assert(comparer == null || comparer == System.Collections.Generic.EqualityComparer<string>.Default || comparer is IWellKnownStringEqualityComparer);
1788Contract.Assert(false, "Missing case in GetRandomizedEqualityComparer!");
1827Contract.Assert(bufferSize % 8 == 0, "We increment our current index by 8, so our buffer size must be a multiple of 8");
system\console.cs (40)
115Contract.Ensures(Contract.Result<Object>() != null);
133Contract.Ensures(Contract.Result<Object>() != null);
272Contract.Ensures(Contract.Result<TextReader>() != null);
306Contract.Ensures(Contract.Result<TextWriter>() != null);
317Contract.Ensures(Contract.Result<TextWriter>() != null);
381Contract.Assert((stdout && _out != null) || (!stdout && _error != null), "Didn't set Console::_out or _error appropriately!");
464Contract.Assert(false, "Unexpected handleType value (" + handleType + ")");
545Contract.Ensures(Contract.Result<Encoding>() != null);
569Contract.EndContractBlock();
598Contract.Ensures(Contract.Result<Encoding>() != null);
620Contract.EndContractBlock();
669Contract.EndContractBlock();
722Contract.EndContractBlock();
771Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!");
812Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!");
837Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!");
865Contract.EndContractBlock();
927Contract.Assert(numWritten == sourceWidth, "FillConsoleOutputCharacter wrote the wrong number of chars!");
995Contract.Assert((int)Win32Native.Color.ColorMask == 0xff, "Make sure one byte is large enough to store a Console color value!");
1097Contract.EndContractBlock();
1281Contract.EndContractBlock();
1323Contract.EndContractBlock();
1396Contract.Assert(title.Length == titleLength);
1409Contract.EndContractBlock();
1759Contract.Assert(false, "ThreadPool.QueueUserWorkItem returned false without throwing. Unable to execute ControlC handler");
1769Contract.Assert(false, "ThreadPool.QueueUserWorkItem did not execute the handler within 30 seconds.");
1829Contract.Assert(_cancelCallbacks == null || _cancelCallbacks.GetInvocationList().Length > 0, "Teach Console::CancelKeyPress to handle a non-null but empty list of callbacks");
1852Contract.EndContractBlock();
1873Contract.EndContractBlock();
1894Contract.EndContractBlock();
1909Contract.EndContractBlock();
1930Contract.EndContractBlock();
1953Contract.EndContractBlock();
system\environment.cs (22)
100Contract.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?");
110Contract.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?");
213Contract.Assert(s!=null, "Managed resource string lookup failed. Was your resource name misspelled? Did you rebuild mscorlib after adding a resource to resources.txt? Debug this w/ cordbg and bug whoever owns the code that called Environment.GetResourceString. Resource name was: \""+key+"\"");
413Contract.Assert(r < Path.MAX_PATH, "r < Path.MAX_PATH");
436Contract.Assert(r < Path.MAX_PATH, "r < Path.MAX_PATH");
449Contract.EndContractBlock();
619Contract.EndContractBlock();
659Contract.EndContractBlock();
673Contract.Assert(environmentKey != null, @"HKLM\System\CurrentControlSet\Control\Session Manager\Environment is missing!");
686Contract.Assert(environmentKey != null, @"HKCU\Environment is missing!");
954Contract.EndContractBlock();
985Contract.Assert(environmentKey != null, @"HKLM\System\CurrentControlSet\Control\Session Manager\Environment is missing!");
1002Contract.Assert(environmentKey != null, @"HKCU\Environment is missing!");
1069Contract.Ensures(Contract.Result<String>() != null);
1122Contract.Ensures(Contract.Result<OperatingSystem>() != null);
1148Contract.Assert(m_os != null, "m_os != null");
1233Contract.Ensures(Contract.Result<String>() != null);
1448Contract.EndContractBlock();
1461Contract.EndContractBlock();
system\globalization\charunicodeinfo.cs (21)
151Contract.Assert(s != null, "s != null");
152Contract.Assert(index >= 0 && index < s.Length, "index < s.Length");
189Contract.Assert(s != null, "s != null");
190Contract.Assert(s.Length > 0, "s.Length > 0");
191Contract.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length");
217Contract.Assert(s != null, "s!=null");
218Contract.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length");
255Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range.");
288Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range.");
339Contract.EndContractBlock();
374Contract.EndContractBlock();
411Contract.EndContractBlock();
427Contract.EndContractBlock();
451Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range.");
479Contract.EndContractBlock();
497Contract.Assert(value != null, "value can not be null");
498Contract.Assert(index < value.Length, "index < value.Length");
511Contract.Assert(str != null, "str can not be null");
512Contract.Assert(str.Length > 0, "str.Length > 0");;
513Contract.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length");
519Contract.Assert(uc >= 0, "uc >= 0");
system\globalization\culturedata.cs (25)
1028Contract.Assert(arrayLength == cultureNames.Length + 2, "CultureData.nativeEnumCultureNames() Incorrect array size");
1074Contract.Assert(name != null, "IsReplacementCultureName(): name should not be null");
1084Contract.Assert(name != null, "IsReplacementCultureName(): replacementCultureNames should not be null");
1109Contract.Assert(this.sRealName != null, "[CultureData.CultureName] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already");
1162Contract.Assert(this.sName != "zh-CHS" && this.sName != "zh-CHT",
1339Contract.Assert(this.sSpecificCulture != null, "[CultureData.SSPECIFICCULTURE] Expected this.sSpecificCulture to be populated by COMNlsInfo::nativeInitCultureData already");
2311Contract.Assert(this.sWindowsName != null, "[CultureData.CalendarIds] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
2386Contract.Assert(calendarId > 0 && calendarId <= CalendarData.MAX_CALENDARS,
2409Contract.Assert(this.sWindowsName != null, "[CultureData.GetCalendar] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
2462Contract.Assert(this.sRealName != null, "[CultureData.IsRightToLeft] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already");
2673Contract.Assert(this.sRealName != null, "[CultureData.ILANGUAGE] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already");
2730Contract.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0");
2737Contract.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0");
2744Contract.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0");
2820Contract.Requires(str != null);
2821Contract.Requires(start >= 0);
2822Contract.Requires(end >= 0);
3017Contract.Assert(startIndex >= 0, "startIndex cannot be negative");
3018Contract.Assert(timeParts.IndexOfAny(new char[] { '\'', '\\' }) == -1, "timeParts cannot include quote characters");
3056Contract.Assert(this.sWindowsName != null, "[CultureData.DoGetLocaleInfo] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
3072Contract.Assert(localeName != null, "[CultureData.DoGetLocaleInfo] Expected localeName to be not be null");
3093Contract.Assert(this.sWindowsName != null, "[CultureData.DoGetLocaleInfoInt] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
3102Contract.Assert(this.sWindowsName != null, "[CultureData.DoEnumTimeFormats] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
3111Contract.Assert(this.sWindowsName != null, "[CultureData.DoEnumShortTimeFormats] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
3176Contract.Assert(this.sWindowsName != null, "[CultureData.GetNFIValues] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
system\globalization\cultureinfo.cs (85)
334Contract.EndContractBlock();
363Contract.Assert(cultureData != null);
371Contract.Assert(name != null);
391Contract.EndContractBlock();
436Contract.EndContractBlock();
454Contract.Assert(cultureID >=0, "[CultureInfo.OnDeserialized] cultureID >= 0");
460Contract.Assert(m_name != null, "[CultureInfo.OnDeserialized] m_name != null");
528Contract.Assert(m_createdDomainID != 0, "[CultureInfo.IsSafeCrossDomain] m_createdDomainID != 0");
535Contract.Assert(m_createdDomainID != 0, "[CultureInfo.CreatedDomain] m_createdDomainID != 0");
585Contract.EndContractBlock();
625Contract.Ensures(Contract.Result<CultureInfo>() != null);
689Contract.Assert(culture!=null, "[CultureInfo.VerifyCultureName]culture!=null");
715Contract.Ensures(Contract.Result<CultureInfo>() != null);
766Contract.Ensures(Contract.Result<CultureInfo>() != null);
790Contract.Ensures(Contract.Result<CultureInfo>() != null);
813Contract.Ensures(Contract.Result<CultureInfo>() != null);
865Contract.Ensures(Contract.Result<CultureInfo>() != null);
960Contract.Ensures(Contract.Result<CultureInfo>() != null);
979Contract.Ensures(Contract.Result<CultureInfo>() != null);
1049Contract.Ensures(Contract.Result<CultureInfo[]>() != null);
1070Contract.Ensures(Contract.Result<String>() != null);
1104Contract.Ensures(Contract.Result<String>() != null);
1134Contract.Ensures(Contract.Result<String>() != null);
1135Contract.Assert(m_name != null, "[CultureInfo.DisplayName]Always expect m_name to be set");
1153Contract.Ensures(Contract.Result<String>() != null);
1170Contract.Ensures(Contract.Result<String>() != null);
1179Contract.Ensures(Contract.Result<String>() != null);
1189Contract.Ensures(Contract.Result<String>() != null);
1205Contract.Ensures(Contract.Result<String>() != null);
1222Contract.Ensures(Contract.Result<CompareInfo>() != null);
1280Contract.Ensures(Contract.Result<TextInfo>() != null);
1358Contract.Ensures(Contract.Result<String>() != null);
1360Contract.Assert(m_name != null, "[CultureInfo.ToString]Always expect m_name to be set");
1412Contract.Ensures(Contract.Result<NumberFormatInfo>() != null);
1426Contract.EndContractBlock();
1444Contract.Ensures(Contract.Result<DateTimeFormatInfo>() != null);
1462Contract.EndContractBlock();
1504Contract.Assert(calType!=Calendar.CAL_GREGORIAN, "calType!=Calendar.CAL_GREGORIAN");
1554Contract.Ensures(Contract.Result<Calendar>() != null);
1556Contract.Assert(this.m_cultureData.CalendarIds.Length > 0, "this.m_cultureData.CalendarIds.Length > 0");
1579Contract.Ensures(Contract.Result<Calendar[]>() != null);
1605Contract.Ensures(Contract.Result<CultureInfo>() != null);
1620Contract.Ensures(Contract.Result<Object>() != null);
1663Contract.Ensures(Contract.Result<CultureInfo>() != null);
1664Contract.EndContractBlock();
1717Contract.EndContractBlock();
1896Contract.Ensures(Contract.Result<CultureInfo>() != null);
1897Contract.EndContractBlock();
1917Contract.Ensures(Contract.Result<CultureInfo>() != null);
1918Contract.EndContractBlock();
1944Contract.Ensures(Contract.Result<CultureInfo>() != null);
1945Contract.EndContractBlock();
1965Contract.Ensures(Contract.Result<CultureInfo>() != null);
2028Contract.Assert(localeType == LOCALE_USER_DEFAULT || localeType == LOCALE_SYSTEM_DEFAULT, "[CultureInfo.GetDefaultLocaleName] localeType must be LOCALE_USER_DEFAULT or LOCALE_SYSTEM_DEFAULT");
system\globalization\datetimeformatinfo.cs (82)
253Contract.Assert(this.abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week");
276Contract.Assert(this.m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.internalGetSuperShortDayNames] Expected 7 day names in a week");
293Contract.Assert(this.dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week");
310Contract.Assert(this.abbreviatedMonthNames.Length == 12 || this.abbreviatedMonthNames.Length == 13,
329Contract.Assert(this.monthNames.Length == 12 || this.monthNames.Length == 13,
348Contract.Requires(cultureData != null);
349Contract.Requires(cal != null);
366Contract.Requires(cultureData != null);
367Contract.Assert(calendarID > 0, "[DateTimeFormatInfo.Populate] Expected Calendar.ID > 0");
378Contract.Assert(this.allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns");
381Contract.Assert(this.allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns");
384Contract.Assert(this.allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns");
387Contract.Assert(this.allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns");
390Contract.Assert(this.allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns");
501Contract.Ensures(Contract.Result<DateTimeFormatInfo>() != null);
518Contract.Ensures(Contract.Result<DateTimeFormatInfo>() != null);
586Contract.Assert(this.amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null");
599Contract.EndContractBlock();
608Contract.Ensures(Contract.Result<Calendar>() != null);
610Contract.Assert(this.calendar != null, "DateTimeFormatInfo.Calendar: calendar != null");
621Contract.EndContractBlock();
735Contract.EndContractBlock();
846Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0");
866Contract.Assert(this.dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null");
878Contract.EndContractBlock();
896Contract.Assert(this.firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1");
925Contract.Assert(this.calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1");
962Contract.EndContractBlock();
994Contract.EndContractBlock();
1033Contract.EndContractBlock();
1056Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0");
1059Contract.Assert(this.monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null");
1070Contract.EndContractBlock();
1090Contract.Assert(this.pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null");
1101Contract.EndContractBlock();
1144Contract.EndContractBlock();
1185Contract.EndContractBlock();
1311Contract.Assert(this.timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null");
1323Contract.EndContractBlock();
1365Contract.EndContractBlock();
1379Contract.Requires(values != null, "value != null");
1380Contract.Requires(values.Length >= length);
1407Contract.EndContractBlock();
1436Contract.EndContractBlock();
1461Contract.EndContractBlock();
1486Contract.EndContractBlock();
1512Contract.EndContractBlock();
1588Contract.Assert(this.m_genitiveAbbreviatedMonthNames.Length == 13,
1597Contract.Assert(this.genitiveMonthNames.Length == 13,
1613Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.internalGetLeapYearMonthNames] Expected Calendar.ID > 0");
1615Contract.Assert(this.leapYearMonthNames.Length == 13,
1630Contract.EndContractBlock();
1649Contract.EndContractBlock();
1660Contract.Requires(patterns1 != null);
1661Contract.Requires(patterns2 != null);
1700Contract.Ensures(Contract.Result<String[]>() != null);
1766Contract.EndContractBlock();
1781Contract.EndContractBlock();
1794Contract.EndContractBlock();
1808Contract.Assert(patterns != null && patterns.Length > 0,
1810Contract.Assert(defaultPattern != null,
1907Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0");
1909Contract.Assert(this.allYearMonthPatterns.Length > 0,
1926Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0");
1928Contract.Assert(this.allShortDatePatterns.Length > 0,
1944Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0");
1946Contract.Assert(this.allLongDatePatterns.Length > 0,
1963Contract.Assert(this.allShortTimePatterns.Length > 0,
1980Contract.Assert(this.allLongTimePatterns.Length > 0,
1993Contract.EndContractBlock();
2059Contract.EndContractBlock();
2129Contract.EndContractBlock();
2157Contract.EndContractBlock();
2234Contract.EndContractBlock();
2727Contract.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber,
2774Contract.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length");
2884Contract.Assert(true, "The hashtable is full. This should not happen.");
2977Contract.Assert(true, "The hashtable is full. This should not happen.");
system\globalization\datetimeparse.cs (19)
119Contract.Assert(dtfi != null, "dtfi == null");
201Contract.Assert(dtfi != null, "dtfi == null");
554Contract.Assert(hourOffset >= 0 && hourOffset <= 99, "hourOffset >= 0 && hourOffset <= 99");
555Contract.Assert(minuteOffset >= 0 && minuteOffset <= 99, "minuteOffset >= 0 && minuteOffset <= 99");
1949Contract.Assert(raw.numCount >= 2, "raw.numCount >= 2");
1969Contract.Assert(raw.numCount >= 3, "raw.numCount >= 3");
2340Contract.Assert(dtfi != null, "dtfi == null");
2610Contract.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified, "result.parsedDate.Kind == DateTimeKind.Unspecified");
2900Contract.Assert(minDigitLen > 0, "minDigitLen > 0");
2901Contract.Assert(maxDigitLen < 9, "maxDigitLen < 9");
2902Contract.Assert(minDigitLen <= maxDigitLen, "minDigitLen <= maxDigitLen");
4188Contract.Assert(false, "Unkown DateTimeParseFailure: " + result);
4417Contract.Assert(Index + count <= len, "__DTString::Advance: Index + count <= len");
4712Contract.Assert(Index >= 0 && Index < len, "Index >= 0 && Index < len");
4720Contract.Assert(Index >= 0 && Index < len, "Index >= 0 && Index < len");
4721Contract.Assert(DateTimeParse.IsDigit(Value[Index]), "IsDigit(Value[Index])");
4854Contract.Assert(number >= 0 && number <= 9, "number >= 0 && number <= 9");
4873Contract.Assert(sub.index == Index, "sub.index == Index");
4874Contract.Assert(sub.index + sub.length <= len, "sub.index + sub.length <= len");
system\globalization\idnmapping.cs (20)
99Contract.EndContractBlock();
115Contract.EndContractBlock();
133Contract.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii]Expected 0 length strings to fail before now.");
222Contract.EndContractBlock();
245Contract.EndContractBlock();
343Contract.EndContractBlock();
482Contract.Assert(d >= 0 && d < punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase");
519Contract.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints.");
527Contract.Assert(delta + skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew.");
565Contract.EndContractBlock();
577Contract.Assert(iNextDot <= unicode.Length, "[IdnMapping.punycode_encode]IndexOfAny is broken");
627Contract.Assert(Char.IsLowSurrogate(unicode, basicCount) == false,
711Contract.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int");
725Contract.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int");
737Contract.Assert(punycodeBase != t, "[IdnMapping.punycode_encode]Expected punycodeBase (36) to be != t");
756Contract.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int");
813Contract.EndContractBlock();
947Contract.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0");
956Contract.Assert(punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != punycodeBase (36)");
968Contract.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0,
system\globalization\textinfo.cs (19)
267Contract.Assert(strA.Length >= indexA + lengthA, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strA.Length >= indexA + lengthA");
268Contract.Assert(strB.Length >= indexB + lengthB, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strB.Length >= indexB + lengthB");
276Contract.Assert(source != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated source != null");
277Contract.Assert(value != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated value != null");
278Contract.Assert(startIndex + count <= source.Length, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex + count <= source.Length");
305Contract.Assert(end - startIndex >= value.Length);
321Contract.Assert(source != null, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated source != null");
322Contract.Assert(value != null, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated value != null");
323Contract.Assert(startIndex - count+1 >= 0, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex - count+1 >= 0");
324Contract.Assert(startIndex <= source.Length, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex <= source.Length");
480Contract.EndContractBlock();
495Contract.EndContractBlock();
531Contract.EndContractBlock();
560Contract.EndContractBlock();
599Contract.EndContractBlock();
716Contract.EndContractBlock();
803Contract.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddNonLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!");
817Contract.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddTitlecaseLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!");
953Contract.EndContractBlock();
system\globalization\timespanformat.cs (14)
148Contract.Assert(dtfi != null, "dtfi == null");
376Contract.Assert(field >= 0 && field <= 5, "field >= 0 && field <= 5");
396Contract.Assert(false, "Unexpected special token '%', Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
406Contract.Assert((field == 0 && sb.Length == 0) || field == 1,
414Contract.Assert((field == 1 && sb.Length == 0) || field == 2,
422Contract.Assert((field == 2 && sb.Length == 0) || field == 3,
430Contract.Assert((field == 3 && sb.Length == 0) || field == 4,
439Contract.Assert((field == 4 && sb.Length == 0) || field == 5,
451Contract.Assert(field == 5);
454Contract.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
455Contract.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
456Contract.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
457Contract.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
458Contract.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
system\io\filestream.cs (100)
163Contract.Assert(_overlapped != null, "Did Overlapped.Pack or Overlapped.UnsafePack just return a null?");
302Contract.Assert(_isComplete == true, "FileStreamAsyncResult::Wait - AsyncFSCallback didn't set _isComplete to true!");
357Contract.Assert(!wh.SafeWaitHandle.IsClosed, "ManualResetEvent already closed!");
359Contract.Assert(r, "ManualResetEvent::Set failed!");
372Contract.Assert(_handle != null, "_handle should not be null.");
373Contract.Assert(_overlapped != null, "Cancel should only be called on true asynchronous FileStreamAsyncResult, i.e. _overlapped is not null");
626Contract.EndContractBlock();
762Contract.Assert(mode != FileMode.Append);
919Contract.Assert(!_exposedHandle, "Are we closing handle that we exposed/not own, how?");
1013Contract.EndContractBlock();
1025Contract.Assert(handleType == Win32Native.FILE_TYPE_DISK || handleType == Win32Native.FILE_TYPE_PIPE || handleType == Win32Native.FILE_TYPE_CHAR, "FileStream was passed an unknown file type!");
1227Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both.");
1240Contract.EndContractBlock();
1263Contract.EndContractBlock();
1361Contract.Assert(_writePos == 0, "FileStream: Write buffer must be empty in FlushRead!");
1363Contract.Assert(CanSeek, "FileStream will lose buffered read data now.");
1374Contract.Assert(_readPos == 0 && _readLen == 0, "FileStream: Read buffer must be empty in FlushWrite!");
1447Contract.EndContractBlock();
1474Contract.Assert(value >= 0, "value >= 0");
1506Contract.EndContractBlock();
1510Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both.");
1555Contract.Assert(_readPos == _readLen, "Read buffer should be empty!");
1570Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed");
1571Contract.Assert(CanRead, "CanRead");
1573Contract.Assert(buffer != null, "buffer != null");
1574Contract.Assert(_writePos == 0, "_writePos == 0");
1575Contract.Assert(offset >= 0, "offset is negative");
1576Contract.Assert(count >= 0, "count is negative");
1602Contract.Assert(r >= 0, "FileStream's ReadCore is likely broken.");
1612Contract.EndContractBlock();
1616Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both.");
1680Contract.Assert(_readLen >= 0 && _readPos <= _readLen, "_readLen should be nonnegative, and _readPos should be less than or equal _readLen");
1681Contract.Assert(pos == Position, "Seek optimization: pos != Position! Buffer math was mangled.");
1691Contract.Assert(!_handle.IsClosed && CanSeek, "!_handle.IsClosed && CanSeek");
1692Contract.Assert(origin>=SeekOrigin.Begin && origin<=SeekOrigin.End, "origin>=SeekOrigin.Begin && origin<=SeekOrigin.End");
1760Contract.EndContractBlock();
1811Contract.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted.");
1826Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed");
1827Contract.Assert(CanWrite, "CanWrite");
1829Contract.Assert(buffer != null, "buffer != null");
1830Contract.Assert(_readPos == _readLen, "_readPos == _readLen");
1831Contract.Assert(offset >= 0, "offset is negative");
1832Contract.Assert(count >= 0, "count is negative");
1862Contract.Assert(r >= 0, "FileStream's WriteCore is likely broken.");
1880Contract.EndContractBlock();
1899Contract.Assert(_isAsync);
1903Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both.");
1932Contract.Assert(_writePos == 0, "FileStream must not have buffered write data here! Pipes should be unidirectional.");
1937Contract.Assert(!_isPipe, "Should not be a pipe.");
2012Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed");
2013Contract.Assert(CanRead, "CanRead");
2014Contract.Assert(bytes != null, "bytes != null");
2015Contract.Assert(_writePos == 0, "_writePos == 0");
2016Contract.Assert(_isAsync, "BeginReadCore doesn't work on synchronous file streams!");
2017Contract.Assert(offset >= 0, "offset is negative");
2018Contract.Assert(numBytes >= 0, "numBytes is negative");
2124Contract.EndContractBlock();
2163Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both.");
2166Contract.Assert(_bufferSize > 0, "_bufferSize > 0");
2192Contract.EndContractBlock();
2211Contract.Assert(_isAsync);
2215Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both.");
2232Contract.Assert(_readPos == 0 && _readLen == 0, "FileStream must not have buffered data here! Pipes should be unidirectional.");
2272Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed");
2273Contract.Assert(CanWrite, "CanWrite");
2274Contract.Assert(bytes != null, "bytes != null");
2275Contract.Assert(_readPos == _readLen, "_readPos == _readLen");
2276Contract.Assert(_isAsync, "BeginWriteCore doesn't work on synchronous file streams!");
2277Contract.Assert(offset >= 0, "offset is negative");
2278Contract.Assert(numBytes >= 0, "numBytes is negative");
2377Contract.EndContractBlock();
2422Contract.Assert(_bufferSize > 0, "_bufferSize > 0");
2436Contract.EndContractBlock();
2452Contract.EndContractBlock();
2488Contract.Requires(handle != null, "handle != null");
2489Contract.Requires(offset >= 0, "offset >= 0");
2490Contract.Requires(count >= 0, "count >= 0");
2491Contract.Requires(bytes != null, "bytes != null");
2496Contract.EndContractBlock();
2498Contract.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter ----up in call to ReadFileNative.");
2543Contract.Requires(handle != null, "handle != null");
2544Contract.Requires(offset >= 0, "offset >= 0");
2545Contract.Requires(count >= 0, "count >= 0");
2546Contract.Requires(bytes != null, "bytes != null");
2553Contract.EndContractBlock();
2555Contract.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter ----up in call to WriteFileNative.");
2613Contract.EndContractBlock();
2665Contract.EndContractBlock();
2723Contract.Assert(task != null);
2732Contract.Assert((!asyncResult.IsWrite && typeof(T) == typeof(int)) ||
2734Contract.Assert(asyncResult != null);
2735Contract.Assert(asyncResult.IsAsync);
2754Contract.Assert(asyncResult != null);
2755Contract.Assert(asyncResult.IsCompleted, "How can we end up in the completion callback if the IAsyncResult is not completed?");
2758Contract.Assert(readTask != null);
2773Contract.Assert(cancellationToken.IsCancellationRequested, "How can the IO operation be aborted if cancellation was not requested?");
2790Contract.Assert(asyncResult != null);
2791Contract.Assert(asyncResult.IsCompleted, "How can we end up in the completion callback if the IAsyncResult is not completed?");
2794Contract.Assert(writeTask != null);
2809Contract.Assert(cancellationToken.IsCancellationRequested, "How can the IO operation be aborted if cancellation was not requested?");
system\io\stream.cs (66)
107Contract.Ensures(Contract.Result<int>() >= 0);
118Contract.Ensures(Contract.Result<int>() >= 0);
157Contract.EndContractBlock();
164Contract.Requires(destination != null);
165Contract.Requires(bufferSize > 0);
166Contract.Requires(CanRead);
167Contract.Requires(destination.CanWrite);
193Contract.EndContractBlock();
213Contract.EndContractBlock();
220Contract.Requires(destination != null);
221Contract.Requires(CanRead);
222Contract.Requires(destination.CanWrite);
223Contract.Requires(bufferSize > 0);
293Contract.Ensures(Contract.Result<WaitHandle>() != null);
300Contract.Ensures(Contract.Result<IAsyncResult>() != null);
307Contract.Ensures(Contract.Result<IAsyncResult>() != null);
344Contract.Assert(thisTask != null, "Inside ReadWriteTask, InternalCurrent should be the ReadWriteTask");
367Contract.Ensures(Contract.Result<int>() >= 0);
368Contract.EndContractBlock();
401Contract.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here.");
447Contract.Ensures(Contract.Result<IAsyncResult>() != null);
454Contract.Ensures(Contract.Result<IAsyncResult>() != null);
490Contract.Assert(thisTask != null, "Inside ReadWriteTask, InternalCurrent should be the ReadWriteTask");
511Contract.Assert(readWriteTask != null); // Should be Contract.Requires, but CCRewrite is doing a poor job with
513Contract.Assert(asyncWaiter != null); // Ditto
518Contract.Assert(asyncWaiter.IsRanToCompletion, "The semaphore wait should always complete successfully.");
525Contract.Assert(t.IsRanToCompletion, "The semaphore wait should always complete successfully.");
537Contract.Requires(readWriteTask != null);
538Contract.Assert(_activeReadWriteTask == null, "Expected no other readers or writers");
554Contract.EndContractBlock();
584Contract.Assert(writeTask.Status == TaskStatus.RanToCompletion);
589Contract.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here.");
636Contract.Requires(function != null);
637Contract.Requires(stream != null);
638Contract.Requires(buffer != null);
639Contract.EndContractBlock();
749Contract.Ensures(Contract.Result<int>() >= -1);
750Contract.Ensures(Contract.Result<int>() < 256);
778Contract.Ensures(Contract.Result<Stream>() != null);
779Contract.EndContractBlock();
795Contract.Ensures(Contract.Result<IAsyncResult>() != null);
821Contract.Ensures(Contract.Result<int>() >= 0);
828Contract.Ensures(Contract.Result<IAsyncResult>() != null);
917Contract.EndContractBlock();
934Contract.EndContractBlock();
1088Contract.EndContractBlock();
1204Contract.Requires(stream != null, "Expected a non-null stream.");
1205Contract.Requires(methodName == "BeginRead" || methodName == "BeginWrite",
1252Contract.Ensures(Contract.Result<int>() >= 0);
1253Contract.EndContractBlock();
1310Contract.EndContractBlock();
system\io\streamreader.cs (31)
171Contract.EndContractBlock();
238Contract.EndContractBlock();
392Contract.EndContractBlock();
453Contract.EndContractBlock();
468Contract.Assert(byteLen >= n, "CompressBuffer was called with a number of bytes greater than the current buffer length. Are two threads using this StreamReader at the same time?");
540Contract.Assert(bytePos <= _preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?");
551Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
574Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
576Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
594Contract.Assert(bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
596Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
656Contract.Assert(charsRead == 0);
659Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
661Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
683Contract.Assert(bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
687Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
912Contract.EndContractBlock();
966Contract.Assert(n == 0);
970Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
973Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
994Contract.Assert(n == 0);
1006Contract.Assert(BytePos_Prop == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
1010Contract.Assert(ByteLen_Prop >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
1040Contract.Assert(n == 0);
1048Contract.Assert(n > 0);
1057Contract.Assert(n > 0);
1100Contract.EndContractBlock();
1196Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
1199Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
1217Contract.Assert(BytePos_Prop == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
1219Contract.Assert(ByteLen_Prop >= 0, "Stream.Read returned a negative number! Bug in stream class.");
system\number.cs (12)
413Contract.Assert(p != null, "");
432Contract.Assert(*p >= 'a' && *p <= 'f', "");
458Contract.Assert(p != null, "");
477Contract.Assert(*p >= 'a' && *p <= 'f', "");
507Contract.Assert(p != null, "");
541Contract.Assert(p != null, "");
575Contract.Assert(p != null, "");
603Contract.Assert(p != null, "");
631Contract.Assert(p != null && str != null, "");
1026Contract.EndContractBlock();
1027Contract.Assert(info != null, "");
1209Contract.Assert(numfmt != null, "");
system\reflection\emit\ilgenerator.cs (33)
35Contract.Requires(incoming != null);
36Contract.Ensures(Contract.Result<int[]>() != null);
37Contract.Ensures(Contract.Result<int[]>().Length > incoming.Length);
124Contract.Requires(methodBuilder != null);
125Contract.Requires(methodBuilder is MethodBuilder || methodBuilder is DynamicMethod);
426Contract.Assert(m_RelocFixupList == null);
490Contract.EndContractBlock();
615Contract.EndContractBlock();
648Contract.EndContractBlock();
666Contract.Assert(opcode.Equals(OpCodes.Calli),
685Contract.EndContractBlock();
700Contract.Assert(opcode.Equals(OpCodes.Call) ||
708Contract.Assert(opcode.Equals(OpCodes.Call) ||
819Contract.EndContractBlock();
869Contract.EndContractBlock();
1172Contract.EndContractBlock();
1235Contract.EndContractBlock();
1310Contract.EndContractBlock();
1339Contract.EndContractBlock();
1481Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1");
1498Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1");
1540Contract.Assert(m_currentCatch > 0,"m_currentCatch > 0");
1541Contract.Assert(m_catchAddr[m_currentCatch-1] > 0,"m_catchAddr[m_currentCatch-1] > 0");
1542Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1");
1604Contract.Requires(exc != null);
1605Contract.Assert(m_currentCatch > 0,"m_currentCatch > 0");
1606Contract.Assert(exc.m_currentCatch > 0,"exc.m_currentCatch > 0");
1615Contract.Assert(exc.GetEndAddress() != GetEndAddress(),
1719Contract.EndContractBlock();
1830Contract.Assert(i < m_DocumentCount, "Bad document look up!");
1921Contract.Assert(document == m_document, "Bad document look up!");
system\resources\manifestbasedresourcegroveler.cs (16)
56Contract.Requires(mediator != null, "mediator shouldn't be null; check caller");
64Contract.Assert(culture != null, "culture shouldn't be null; check caller");
65Contract.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller");
236Contract.Assert(a != null, "assembly != null");
269Contract.Assert(false, "mscorlib's NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + cultureName + "\" Exception: " + e);
286Contract.Assert(store != null, "I need a Stream!");
366Contract.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here.");
432Contract.Requires(satellite != null, "satellite shouldn't be null; check caller");
433Contract.Requires(fileName != null, "fileName shouldn't be null; check caller");
457Contract.Requires(satellite != null, "satellite shouldn't be null; check caller");
458Contract.Requires(name != null, "name shouldn't be null; check caller");
570Contract.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + " with error code 0x" + hr.ToString("X", CultureInfo.InvariantCulture) + Environment.NewLine + "Exception: " + fle);
577Contract.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + Environment.NewLine + "Exception: " + bife);
605Contract.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller");
606Contract.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller");
675Contract.Assert(false, "Couldn't get mscorlib" + ResourceManager.ResFileExtension + " from mscorlib's assembly" + Environment.NewLine + Environment.NewLine + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug.");
system\resources\resourcereader.cs (27)
71Contract.Assert(value >= 0, "negative ResourceTypeCode. What?");
186Contract.EndContractBlock();
204Contract.Requires(stream != null, "Need a stream!");
205Contract.Requires(stream.CanRead, "Stream should be readable!");
206Contract.Requires(resCache != null, "Need a Dictionary!");
274Contract.Assert(index >=0 && index < _numResources, "Bad index into hash array. index: "+index);
275Contract.Assert((_ums == null && _nameHashes != null && _nameHashesPtr == null) ||
286Contract.Assert(index >=0 && index < _numResources, "Bad index into name position array. index: "+index);
287Contract.Assert((_ums == null && _namePositions != null && _namePositionsPtr == null) ||
323Contract.Assert(_store != null, "ResourceReader is closed!");
405Contract.Assert(_store != null, "ResourceReader is closed!");
443Contract.Assert(_store != null, "ResourceReader is closed!");
507Contract.Assert(_store != null, "ResourceReader is closed!");
532Contract.Assert(_store != null, "ResourceReader is closed!");
585Contract.Assert(_store != null, "ResourceReader is closed!");
586Contract.Assert(_version == 1, ".resources file was not a V1 .resources file!");
661Contract.Assert(_store != null, "ResourceReader is closed!");
662Contract.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!");
759Contract.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)");
859Contract.Assert(_store != null, "ResourceReader is closed!");
1110Contract.Assert(_typeTable[typeIndex] != null, "Should have found a type!");
1188Contract.EndContractBlock();
1222Contract.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!");
1225Contract.Assert(len >= 0 && len <= (int) _store.BaseStream.Length - dataPos + _dataSectionOffset, "Length was negative or outside the bounds of the file!");
1247Contract.Requires(typeCode >= 0, "can't be negative");
1249Contract.Assert(!String.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers.");
1254Contract.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
system\runtime\compilerservices\AsyncMethodBuilder.cs (27)
73Contract.EndContractBlock();
117Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action.");
127Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference");
163Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action.");
173Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference");
204Contract.EndContractBlock();
234Contract.Assert(m_synchronizationContext != null, "Must only be used with a non-null context.");
305Contract.EndContractBlock();
460Contract.EndContractBlock();
504Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action.");
515Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference");
544Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action.");
555Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference");
594Contract.Assert(m_task != null, "GetTaskForResult should never return null");
623Contract.Requires(completedTask != null, "Expected non-null task");
624Contract.Requires(completedTask.Status == TaskStatus.RanToCompletion, "Expected a successfully completed task");
650Contract.EndContractBlock();
715Contract.Ensures(
716EqualityComparer<TResult>.Default.Equals(result, Contract.Result<Task<TResult>>().Result),
818Contract.Assert(EXCLUSIVE_INT32_MAX >= INCLUSIVE_INT32_MIN, "Expected max to be at least min");
887Contract.EndContractBlock();
904Contract.Assert(m_defaultContextAction == null || m_stateMachine != null,
927Contract.Assert(m_stateMachine != null, "If the delegate was set, the state machine should have been as well.");
995Contract.Assert(runner.m_stateMachine == null, "The runner's state machine should not yet have been populated.");
996Contract.Assert(m_stateMachine != null, "The builder's state machine field should have been initialized.");
1059Contract.Assert(m_stateMachine != null, "The state machine must have been set before calling Run.");
1109Contract.Requires(continuation != null, "Expected non-null continuation");
system\runtime\compilerservices\TaskAwaiter.cs (13)
73Contract.Requires(task != null, "Constructing an awaiter requires a task to await.");
149Contract.Assert(taskCompleted, "With an infinite timeout, the task should have always completed.");
162Contract.Requires(task.IsCompleted, "Task must have been completed by now.");
163Contract.Requires(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully.");
177Contract.Assert(false, "Throw() should have thrown");
188Contract.Assert(false, "Throw() should have thrown");
193Contract.Assert(false, "There should be exceptions if we're Faulted.");
233Contract.Requires(task != null, "Need a task to wait on");
234Contract.Requires(continuation != null, "Need a continuation to invoke when the wait completes");
310Contract.Requires(task != null, "Constructing an awaiter requires a task to await.");
370Contract.Requires(task != null, "Constructing an awaitable requires a task to await.");
399Contract.Requires(task != null, "Constructing an awaiter requires a task to await.");
487Contract.Requires(task != null, "Constructing an awaiter requires a task to await.");
system\runtime\interopservices\tceadaptergen\eventproviderwriter.cs (33)
100Contract.Assert(DelegateField != null, "Unable to find the field m_" + SrcItfMethod.Name + "Delegate on the sink helper");
104Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper");
108Contract.Assert(SinkHelperCons != null, "Unable to find the constructor for the sink helper");
112Contract.Assert(CPAdviseMethod != null, "Unable to find the method ConnectionPoint.Advise");
118Contract.Assert(ArrayListAddMethod != null, "Unable to find the method ArrayList.Add");
122Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()");
127Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()");
243Contract.Assert(DelegateField != null, "Unable to find the field m_" + SrcItfMethod.Name + "Delegate on the sink helper");
247Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper");
253Contract.Assert(ArrayListRemoveMethod != null, "Unable to find the method ArrayList.RemoveAt()");
257Contract.Assert(ArrayListItemProperty != null, "Unable to find the property ArrayList.Item");
259Contract.Assert(ArrayListItemGetMethod != null, "Unable to find the get method for property ArrayList.Item");
263Contract.Assert(ArrayListSizeProperty != null, "Unable to find the property ArrayList.Count");
265Contract.Assert(ArrayListSizeGetMethod != null, "Unable to find the get method for property ArrayList.Count");
270Contract.Assert(DelegateEqualsMethod != null, "Unable to find the method Delegate.Equlals()");
274Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()");
279Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()");
283Contract.Assert(CPUnadviseMethod != null, "Unable to find the method ConnectionPoint.Unadvise()");
287Contract.Assert(ReleaseComObjectMethod != null, "Unable to find the method Marshal.ReleaseComObject()");
467Contract.Assert(DefaultArrayListCons != null, "Unable to find the constructor for class ArrayList");
476Contract.Assert(ByteArrayGUIDCons != null, "Unable to find the constructor for GUID that accepts a string as argument");
480Contract.Assert(CPCFindCPMethod != null, "Unable to find the method ConnectionPointContainer.FindConnectionPoint()");
557Contract.Assert(DefaultBaseClsCons != null, "Unable to find the object's public default constructor");
588Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper");
592Contract.Assert(ArrayListItemProperty != null, "Unable to find the property ArrayList.Item");
594Contract.Assert(ArrayListItemGetMethod != null, "Unable to find the get method for property ArrayList.Item");
598Contract.Assert(ArrayListSizeProperty != null, "Unable to find the property ArrayList.Count");
600Contract.Assert(ArrayListSizeGetMethod != null, "Unable to find the get method for property ArrayList.Count");
604Contract.Assert(CPUnadviseMethod != null, "Unable to find the method ConnectionPoint.Unadvise()");
608Contract.Assert(ReleaseComObjectMethod != null, "Unable to find the method Marshal.ReleaseComObject()");
612Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()");
618Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()");
747Contract.Assert(SuppressFinalizeMethod != null, "Unable to find the GC.SuppressFinalize");
system\runtime\remoting\activationservices.cs (32)
160Contract.Assert(!serverType.IsInterface,"!serverType.IsInterface");
172Contract.Assert(null != pa, "null != pa");
197Contract.Assert(null != retObj, "null != retObj");
205Contract.Assert(!serverType.IsInterface,"!serverType.IsInterface");
218Contract.Assert(null != pa, "null != pa");
229Contract.Assert(null != retObj, "null != retObj");
398Contract.Assert(
425Contract.Assert(pa!=null, "expect proxy attribute");
539Contract.Assert(
544Contract.Assert(ctorMsg.ActivationType.IsContextful,
558Contract.Assert(
564Contract.Assert(
617Contract.Assert(
759Contract.Assert(reqMsg!=null, "NULL ctorReqMsg");
771Contract.Assert(replyMsg!=null, "NULL ctorRetMsg");
840Contract.Assert(
1103Contract.Assert(_attributeStack != null, "Pop w/o a prior Set()?");
1214Contract.Assert(ctorMsg!=null, "ctorMsg null?");
1224Contract.Assert(
1249Contract.Assert(
1317Contract.EndContractBlock();
1393Contract.Assert(ctorMsg != null, "Null ctorMsg");
1472Contract.EndContractBlock();
1522Contract.Assert(remActivatorURL!=null,"Bad activator URL");
1531Contract.EndContractBlock();
1585Contract.EndContractBlock();
1681Contract.Assert(cp != null && cp.Count > 0,"Bad _cp?");
1740Contract.Assert(typ!=null, "typ != null");
1741Contract.Assert(attr!=null, "attr != null");
1748Contract.Assert(newAttr.Length == newTypes.Length,"These should be in sync!");
1761Contract.Assert(typ!=null, "typ != null");
1774Contract.Assert(typ!=null, "typ != null");
system\runtime\remoting\identityholder.cs (17)
112Contract.Assert(
167Contract.EndContractBlock();
232Contract.Assert(
288Contract.Assert(null != serverCtx, "null != serverCtx");
296Contract.Assert(srvID == MarshalByRefObject.GetIdentity(obj), "Bad ID state!" );
302Contract.Assert(null != rp, "null != rp");
389Contract.Assert(null != srvID,"null != srvID");
404Contract.Assert(null != objURI,"null != objURI");
473Contract.Assert(null != idObj,"null != idObj");
491Contract.Assert(null != idObj,"null != idObj");
494Contract.Assert(
506Contract.Assert(bServerIDSet,"idObj should be ServerIdentity");
525Contract.Assert(null != idObj.URI,"null != idObj.URI");
553Contract.Assert(
569Contract.Assert(
603Contract.Assert(false, "Invalid DuplicateIdentityOption");
721Contract.Assert(uri!=null, "Null URI");
system\runtime\remoting\message.cs (25)
303Contract.EndContractBlock();
496Contract.Assert(mb != null, "null method base passed to CoerceArgs");
516Contract.EndContractBlock();
1345Contract.Assert(_message == null, "Can't set frame twice on ConstructorCallMessage");
2222Contract.Assert(_enumHash != null,"_enumHash != null");
2249Contract.Assert(_enumHash != null,"_enumHash != null");
2870Contract.EndContractBlock();
2893Contract.EndContractBlock();
2972Contract.EndContractBlock();
3239Contract.Assert(
3973Contract.Assert(value==null, "Phoney type in CCM");
4127Contract.EndContractBlock();
4230Contract.EndContractBlock();
4308Contract.EndContractBlock();
4855Contract.Assert(_obj != null, "SerializationMonkey's _obj field should have been initialized elsewhere with a special hack.");
4962Contract.Assert(targetCtxID!=IntPtr.Zero, "bad target ctx for call back");
4985Contract.Assert(targetCtxID != IntPtr.Zero, "bad target ctx for call back");
4986Contract.Assert(targetDomainID !=0, "bad target ctx for call back");
5015Contract.Assert(channelSink != null, "X-domain transition failure");
5026Contract.EndContractBlock();
5035Contract.Assert(_targetDomainID != 0, "target domain should be non-zero");
5068Contract.Assert(Thread.CurrentContext.InternalContextID
5087Contract.Assert(ctx != null, "Null target context unexpected!");
5153Contract.Assert(
5213Contract.EndContractBlock();
system\runtime\remoting\remotingservices.cs (26)
424Contract.Assert(!(obj is ContextBoundObject), "ContextBoundObject's shouldn't get here.");
432Contract.Assert(null != serverCtx, "null != serverCtx");
438Contract.Assert(idObj == MarshalByRefObject.GetIdentity(obj), "Bad ID state!" );
452Contract.Assert(obj is ContextBoundObject, "Object should have been a ContextBoundObject.");
529Contract.Assert(null != idObj.ObjURI,"null != idObj.ObjURI");
534Contract.Assert(null != idObj,"null != idObj");
545Contract.Assert(null != realProxy,"null != realProxy");
688Contract.Assert(null != realProxy,"null != realProxy");
707Contract.Assert(null != idObj, "null != idObj");
719Contract.Assert(srvID != null && Obj is ContextBoundObject,
749Contract.Assert(srvID == idObj, "Bad ID Table state!");
756Contract.Assert(idObj.ObjURI != null, "Client side id without URI!");
774Contract.Assert(null != idObj.ObjURI,"null != idObj.ObjURI");
821Contract.EndContractBlock();
872Contract.EndContractBlock();
975Contract.EndContractBlock();
1066Contract.Assert(obj.GetType().IsContextful,"objType.IsContextful");
2218Contract.Assert(IsTransparentProxy(tp),"Must be called only for TPs");
2298Contract.Assert(
2348Contract.Assert(IsTransparentProxy(tp), "IsTransparentProxy(tp)");
2354Contract.Assert(!(id is ServerIdentity), "(!id is ServerIdentity)");
2471Contract.EndContractBlock();
2511Contract.EndContractBlock();
2605Contract.EndContractBlock();
2642Contract.EndContractBlock();
2780Contract.Assert(condition, message);
system\runtime\remoting\synchronizeddispatch.cs (24)
88Contract.Assert(
97Contract.Assert(
101Contract.Assert(
187Contract.EndContractBlock();
197Contract.Assert(ctx.GetProperty(PROPERTY_NAME) != this,
231Contract.Assert(_flavor == REQUIRED,"Use cli-ctx property only for the REQUIRED flavor");
284Contract.Assert(_locked==true,"_locked==true");
292Contract.Assert(work!=null,"work!=null");
293Contract.Assert(work.IsSignaled() && !(work.IsDummy()),"work.IsSignaled() && !(work.IsDummy())");
308Contract.Assert(_locked==true,"_locked==true");
335Contract.Assert(_locked==true,"_locked==true");
452Contract.Assert(_locked==true,"_locked==true");
482Contract.Assert(_locked==true,"_locked==true");
498Contract.Assert(_locked==true,"_locked==true");
720Contract.Assert(!IsWaiting(),"!IsWaiting()");
732Contract.Assert(!IsSignaled(),"!IsSignaled()");
795Contract.Assert(IsSignaled(),"IsSignaled()");
836Contract.Assert(_property.Locked == true,"_property.Locked == true");
853Contract.Assert(_property.Locked == true,"_property.Locked == true");
878Contract.Assert(
890Contract.Assert(lcid.Equals(_property.SyncCallOutLCID), "Bad synchronization domain state!");
910Contract.Assert(
930Contract.Assert(_property.Locked == true,"_property.Locked == true");
953Contract.Assert(
system\runtime\serialization\objectmanager.cs (44)
126Contract.Assert(objectID>0,"objectID>0");
170Contract.Assert(holder!=null,"holder!=null");
172Contract.Assert(holder.m_id>=0,"holder.m_id>=0");
254Contract.Assert(holder.RequiresSerInfoFixup,"[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable");
257Contract.Assert(surrogate!=null,"surrogate!=null");
269Contract.Assert(holder.ObjectValue is ISerializable,"holder.m_object is ISerializable");
296Contract.Assert(holder.IsIncompleteObjectReference,"holder.IsIncompleteObjectReference");
362Contract.Assert(holder!=null, "[TypedReferenceBuilder.ctor]holder!=null");
363Contract.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup");
404Contract.Assert(currFixup.ParentIndex!=null, "[ObjectManager.DoValueTypeFixup]currFixup.ParentIndex!=null");
419Contract.Assert(fixupObj!=null, "[ObjectManager.DoValueTypeFixup]FixupObj!=null");
445Contract.Assert(fixupObj!=null, "[ObjectManager.DoValueTypeFixup]fixupObj!=null");
500Contract.Assert(holder!=null,"[ObjectManager.CompleteObject]holder.m_object!=null");
524Contract.Assert(fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup,"fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup");
578Contract.Assert(holder.ObjectValue is Array,"holder.ObjectValue is Array");
586Contract.Assert(fixupInfo is MemberInfo,"fixupInfo is MemberInfo");
672Contract.Assert(temp.DirectlyDependentObjects>0,"temp.m_missingElementsRemaining>0");
693Contract.EndContractBlock();
731Contract.Assert(member == null || member is FieldInfo, "RegisterString - member is FieldInfo");
732Contract.Assert((FindObjectHolder(objectID) == null), "RegisterString - FindObjectHolder(objectID) == null");
747Contract.EndContractBlock();
865Contract.EndContractBlock();
948Contract.Assert(m_fixupCount>=0,"[ObjectManager.DoFixups]m_fixupCount>=0");
1021Contract.EndContractBlock();
1053Contract.EndContractBlock();
1088Contract.EndContractBlock();
1173Contract.Assert(objID>=0,"objID>=0");
1207Contract.Assert(objID>=0,"objID>=0");
1253Contract.Assert(m_dependentObjects!=null, "[ObjectHolder.RemoveDependency]m_dependentObjects!=null");
1254Contract.Assert(id>=0, "[ObjectHolder.RemoveDependency]id>=0");
1296Contract.Assert(holder!=null, "[ObjectHolder.UpdateTotalDependencyChain]holder!=null");
1334Contract.Assert(obj!=null,"obj!=null");
1335Contract.Assert(m_id>0,"m_id>0");
1576Contract.Assert(id>0,"id>0");
1577Contract.Assert(fixupInfo!=null,"fixupInfo!=null");
1578Contract.Assert(fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup,"fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup");
1685Contract.Assert(m_currentItem!=-1, "[LongList.Current]m_currentItem!=-1");
1686Contract.Assert(m_values[m_currentItem]!=-1, "[LongList.Current]m_values[m_currentItem]!=-1");
1731Contract.Assert(startingSize>0 && startingSize<0x1000,"startingSize>0 && startingSize<0x1000");
1784Contract.Assert(list!=null, "[ObjectHolderListEnumerator.ctor]list!=null");
1792Contract.Assert(m_startingVersion==m_list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version");
1811Contract.Assert(m_currPos!=-1, "[ObjectHolderListEnumerator.Current]m_currPos!=-1");
1812Contract.Assert(m_currPos<m_list.Count, "[ObjectHolderListEnumerator.Current]m_currPos<m_list.Count");
1813Contract.Assert(m_startingVersion==m_list.Version, "[ObjectHolderListEnumerator.Current]m_startingVersion==m_list.Version");
system\runtime\serialization\serializationinfo.cs (21)
77Contract.EndContractBlock();
108Contract.EndContractBlock();
130Contract.EndContractBlock();
150Contract.EndContractBlock();
255Contract.Assert(m_members.Length == m_currMember, "[SerializationInfo.ExpandArrays]m_members.Length == m_currMember");
300Contract.EndContractBlock();
432Contract.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null");
433Contract.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null");
434Contract.Assert(null != (object)type, "[SerializationInfo.UpdateValue]type!=null");
455Contract.EndContractBlock();
483Contract.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length");
484Contract.Assert(index < m_types.Length, "[SerializationInfo.GetElement]index<m_types.Length");
487Contract.Assert((object)foundType != null, "[SerializationInfo.GetElement]foundType!=null");
502Contract.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length");
503Contract.Assert(index < m_types.Length, "[SerializationInfo.GetElement]index<m_types.Length");
506Contract.Assert((object)foundType != null, "[SerializationInfo.GetElement]foundType!=null");
523Contract.EndContractBlock();
547Contract.Assert(m_converter != null, "[SerializationInfo.GetValue]m_converter!=null");
560Contract.Assert((object)type != null, "[SerializationInfo.GetValue]type ==null");
561Contract.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type");
580Contract.Assert(m_converter != null, "[SerializationInfo.GetValue]m_converter!=null");
system\runtime\versioning\binarycompatibility.cs (13)
118Contract.Ensures(Contract.Result<TargetFrameworkId>() > TargetFrameworkId.NotYetChecked);
132Contract.Ensures(Contract.Result<int>() > 0 || s_AppWasBuiltForFramework == TargetFrameworkId.Unspecified);
137Contract.Assert(s_AppWasBuiltForFramework != TargetFrameworkId.Unrecognized);
188Contract.Requires(buildAgainstVersion > 0 || builtAgainstFramework == TargetFrameworkId.Unspecified);
256Contract.Assert(false, "Bad framework kind");
259Contract.Assert(false, "Error: we introduced a new Target Framework but did not update our binary compatibility map");
270Contract.Requires(!String.IsNullOrEmpty(targetFrameworkMoniker));
334Contract.Assert(false, "This is a phone app, but we can't tell what version this is!");
340Contract.Assert(false, String.Format(CultureInfo.InvariantCulture, "Unrecognized Silverlight profile \"{0}\". What is this, an XBox app?", profile));
347Contract.Assert(false, String.Format(CultureInfo.InvariantCulture, "Unrecognized Target Framework Moniker in our Binary Compatibility class. Framework name: \"{0}\"", targetFrameworkMoniker));
370Contract.EndContractBlock();
system\security\accesscontrol\privilege.cs (7)
139Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "LookupPrivilegeValue() failed with unrecognized error code {0}", error ));
250Contract.Assert( this.isImpersonating == false, "Incorrect isImpersonating state" );
314Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "WindowsIdentity.GetCurrentThreadToken() failed with unrecognized error code {0}", error ));
411Contract.EndContractBlock();
424Contract.Assert( !this.needToRevert, "Must revert privileges that you alter!" );
579Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "AdjustTokenPrivileges() failed with unrecognized error code {0}", error ));
669Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "AdjustTokenPrivileges() failed with unrecognized error code {0}", error ));
system\security\cryptography\capinative.cs (20)
277Contract.Assert(keyContainer == null, "Key containers are not supported");
305Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid");
306Contract.Assert(((AlgorithmClass)algorithm & AlgorithmClass.Hash) == AlgorithmClass.Hash, "Invalid hash algorithm");
321Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid");
322Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0");
335Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid");
336Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0");
337Contract.Assert(offset >= 0 && count > 0, "offset >= 0 && count > 0");
338Contract.Assert(buffer.Length >= offset + count, "buffer.Length >= offset + count");
355Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size");
364Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid");
392Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size");
401Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid");
430Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "hashHandle != null && !hashHandle.IsInvalid");
448Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid");
449Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid");
450Contract.Assert(((AlgorithmClass)signatureAlgorithm & AlgorithmClass.Signature) == AlgorithmClass.Signature, "Invalid signature algorithm");
451Contract.Assert(((AlgorithmClass)hashAlgorithm & AlgorithmClass.Hash) == AlgorithmClass.Hash, "Invalid hash algorithm");
452Contract.Assert(hashValue != null, "hashValue != null");
453Contract.Assert(signature != null, "signature != null");
system\security\permissionset.cs (44)
261Contract.EndContractBlock();
380Contract.Assert( PermissionToken.IsTokenProperlyAssigned( perm, PermissionToken.GetToken( perm ) ),
382Contract.Assert( PermissionToken.GetToken( perm ).m_index == index,
699Contract.Assert( demandedPerm != null, "Expected non-null value" );
707Contract.Assert( tokenDemandedPerm != null, "Unable to find token for demanded permission" );
722Contract.Assert(demandedSet != null, "Expected non-null value");
746Contract.Assert( child is SecurityElement, "SecurityElement expected" );
748Contract.Assert( elChild.InternalChildren != null,
754Contract.Assert( !current.GetTag().Equals( parent.Tag ),
823Contract.Assert( thisElem is SecurityElement, "SecurityElement expected" );
868Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
877Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1029Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1039Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1055Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1065Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1087Contract.Assert( intersectPerm == null || PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1160Contract.Assert( thisElem is SecurityElement, "SecurityElement expected" );
1301Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1311Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1330Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1351Contract.Assert( unionPerm == null || PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
1762Contract.EndContractBlock();
1795Contract.Assert( objectToInsert.GetType().Module.Assembly == System.Reflection.Assembly.GetExecutingAssembly(),
1798Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should always know the permission type when getting a token from an instance" );
1817Contract.Assert( PermissionToken.IsTokenProperlyAssigned( ip, token ),
1860Contract.EndContractBlock();
1902Contract.Assert( objectToInsert.GetType().Module.Assembly == System.Reflection.Assembly.GetExecutingAssembly(),
1905Contract.Assert((token != null), "PermissionToken.GetToken returned null ");
1906Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should always know the permission type when getting a token from an instance" );
1925Contract.Assert( PermissionToken.IsTokenProperlyAssigned( ip, token ),
2040Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should know the permission type already" );
2050Contract.Assert( tempPerm != null, "We should only come here if we have a real permission" );
2071Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should know the permission type already" );
2096Contract.Assert( false, "Unrecognized case found during permission creation" );
2118Contract.Assert(perm == null || PermissionToken.IsTokenProperlyAssigned( perm, PermissionToken.GetToken( perm ) ), "PermissionToken was improperly assigned");
2141Contract.Assert( false, "No Permission or IPermission tag found" );
2221Contract.Assert( this.GetType().FullName.Equals( "System.Security.PermissionSet" ), "Class name changed! Was: System.Security.PermissionSet Should be:" + this.GetType().FullName);
2382Contract.Assert(casPset == null || !casPset.IsReadOnly);
2383Contract.Assert(nonCasPset == null || !nonCasPset.IsReadOnly);
2431Contract.Assert(i == 0 || ((SecurityAttribute)attrs[i]).m_action == ((SecurityAttribute)attrs[i - 1]).m_action, "Mixed SecurityActions");
2460Contract.Assert(serialize || nonCasPset == null, "We shouldn't separate nonCAS permissions unless fSerialize is true");
2521Contract.Assert((assertSet == null || !assertSet.IsUnrestricted()), "Cannot be unrestricted here");
2577Contract.Assert(!assertSet.IsUnrestricted(), "Cannot call this function if assertSet is unrestricted");
system\security\permissiontoken.cs (12)
70Contract.EndContractBlock();
108Contract.Assert( c_mscorlibName == ((RuntimeAssembly)Assembly.GetExecutingAssembly()).GetSimpleName(),
163Contract.Assert( method != null, "IBuiltInPermission types should have a static method called 'GetTokenIndex'" );
169Contract.Assert(getTokenIndex != null, "method is not a RuntimeMethodInfo");
251Contract.Assert( method != null, "IBuiltInPermission types should have a static method called 'GetTokenIndex'" );
257Contract.Assert(getTokenIndex != null, "method is not a RuntimeMethodInfo");
293Contract.Assert( (m_type & PermissionTokenType.DontKnow) == 0, "Should have valid token type when ToXml is called" );
309Contract.Assert( false, "Tried to deserialize non-PermissionToken element here" );
320Contract.Assert((this.m_type & PermissionTokenType.DontKnow) == 0, "Should have valid token type when FromXml is called.");
403Contract.Assert( cls != null, "Must pass in valid type" );
459Contract.Assert( !(perm is IBuiltInPermission), "This should not be called for built-ins" );
467Contract.Assert( cls.GetInterface( "System.Security.Permissions.IBuiltInPermission" ) == null, "This shoudl not be called for built-ins" );
system\security\principal\sid.cs (13)
199Contract.EndContractBlock();
311Contract.EndContractBlock();
406Contract.EndContractBlock();
424Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.CreateSidFromString returned unrecognized error {0}", Error ));
475Contract.EndContractBlock();
526Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.GetWindowsAccountDomainSid returned unrecognized error {0}", ErrorCode) );
549Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.CreateWellKnownSid returned unrecognized error {0}", Error ));
757Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.GetWindowsAccountDomainSid returned unrecognized error {0}", Error) );
787Contract.EndContractBlock();
847Contract.EndContractBlock();
932Contract.EndContractBlock();
998Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32Native.LsaLookupSids returned {0}", win32ErrorCode));
1114Contract.EndContractBlock();
system\string.cs (221)
87Contract.EndContractBlock();
95Contract.EndContractBlock();
125Contract.Ensures(Contract.Result<String>() != null);
126Contract.EndContractBlock();
164Contract.Ensures(Contract.Result<String>() != null);
165Contract.EndContractBlock();
216Contract.EndContractBlock();
262Contract.Assert(*(pointerToJointString + charBuffer.Length) == '\0', "String must be null-terminated!");
271Contract.Requires(strA != null);
272Contract.Requires(strB != null);
273Contract.EndContractBlock();
286Contract.Assert((charA | charB) <= 0x7F, "strings have to be ASCII");
325Contract.Requires(strIn != null);
326Contract.EndContractBlock();
339Contract.Assert(c <= 0x7F, "string has to be ASCII");
347Contract.Assert(outBuff[length]=='\0', "outBuff[length]=='\0'");
366Contract.Requires(strA != null);
367Contract.Requires(strB != null);
368Contract.Requires(strA.Length == strB.Length);
420Contract.Requires(strA != null);
421Contract.Requires(strB != null);
422Contract.Requires(strA.Length == strB.Length, "Lengths of strA and strB must be the same");
436Contract.Assert((charA | charB) <= 0x7F, "strings have to be ASCII");
464Contract.Requires(strA != null);
465Contract.Requires(strB != null);
515Contract.Assert( *(a+1) != *(b+1), "This byte must be different if we reach here!");
538Contract.Assert( *(a+1) != *(b+1), "This byte must be different if we reach here!");
591Contract.EndContractBlock();
658Contract.EndContractBlock();
742Contract.EndContractBlock();
779Contract.EndContractBlock();
844Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'");
845Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary");
901Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'");
902Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary");
976Contract.Ensures(Contract.Result<String[]>() != null);
992Contract.Ensures(Contract.Result<String[]>() != null);
998Contract.Ensures(Contract.Result<String[]>() != null);
1005Contract.Ensures(Contract.Result<String[]>() != null);
1018Contract.Ensures(Contract.Result<String[]>() != null);
1019Contract.EndContractBlock();
1050Contract.Ensures(Contract.Result<String[]>() != null);
1064Contract.EndContractBlock();
1101Contract.Requires(numReplaces >= 0);
1102Contract.Requires(count >= 2);
1103Contract.Ensures(Contract.Result<String[]>() != null);
1137Contract.Requires(numReplaces >= 0);
1138Contract.Requires(count >= 2);
1139Contract.Ensures(Contract.Result<String[]>() != null);
1166Contract.Assert(arrIndex < maxItems);
1231Contract.Assert(separators != null && separators.Length > 0, "separators != null && separators.Length > 0");
1288Contract.EndContractBlock();
1303Contract.Assert( startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!");
1304Contract.Assert( length >= 0 && startIndex <= this.Length - length, "length is out of range!");
1405Contract.Requires(bytes != null);
1406Contract.Requires(byteLength >= 0);
1410Contract.Assert(stringLength >= 0, "stringLength >= 0");
1421Contract.Assert(stringLength == doubleCheck,
1441Contract.Assert(cbNativeBuffer >= (Length + 1) * Marshal.SystemMaxDBCSCharSize, "Insufficient buffer length passed to ConvertToAnsi");
1539Contract.Requires(dest != null);
1540Contract.Requires(src != null);
1544Contract.EndContractBlock();
1607Contract.EndContractBlock();
1708Contract.Assert(this == null, "this == null"); // this is the string constructor, we allocate it
1735Contract.EndContractBlock();
1736Contract.Assert(this == null, "this == null"); // this is the string constructor, we allocate it
1806Contract.EndContractBlock();
1866Contract.EndContractBlock();
1884Contract.EndContractBlock();
1953Contract.EndContractBlock();
1987Contract.EndContractBlock();
2013Contract.EndContractBlock();
2197Contract.EndContractBlock();
2236Contract.EndContractBlock();
2333Contract.EndContractBlock();
2360Contract.EndContractBlock();
2455Contract.EndContractBlock();
2475Contract.EndContractBlock();
2562Contract.EndContractBlock();
2577Contract.EndContractBlock();
2623Contract.EndContractBlock();
2641Contract.Ensures(Contract.Result<String>() != null);
2642Contract.EndContractBlock();
2652Contract.Ensures(Contract.Result<String>() != null);
2653Contract.EndContractBlock();
2660Contract.Ensures(Contract.Result<String>() != null);
2661Contract.EndContractBlock();
2668Contract.Ensures(Contract.Result<String>() != null);
2669Contract.EndContractBlock();
2680Contract.Ensures(Contract.Result<String>() != null);
2681Contract.EndContractBlock();
2689Contract.Ensures(Contract.Result<String>() != null);
2690Contract.EndContractBlock();
2697Contract.Ensures(Contract.Result<String>() != null);
2698Contract.EndContractBlock();
2703Contract.Ensures(Contract.Result<String>() != null);
2704Contract.EndContractBlock();
2711Contract.Ensures(Contract.Result<Object>() != null);
2712Contract.EndContractBlock();
2737Contract.Ensures(Contract.Result<String>() != null);
2738Contract.EndContractBlock();
2828Contract.Ensures(Contract.Result<String>() != null);
2829Contract.Ensures(Contract.Result<String>().Length == this.Length + value.Length);
2830Contract.EndContractBlock();
2865Contract.Ensures(Contract.Result<String>() != null);
2866Contract.Ensures(Contract.Result<String>().Length == this.Length);
2867Contract.EndContractBlock();
2884Contract.Ensures(Contract.Result<String>() != null);
2885Contract.EndContractBlock();
2921Contract.Ensures(Contract.Result<String>() != null);
2922Contract.Ensures(Contract.Result<String>().Length == this.Length - count);
2923Contract.EndContractBlock();
2954Contract.Ensures(Contract.Result<String>() != null);
2955Contract.EndContractBlock();
2961Contract.Ensures(Contract.Result<String>() != null);
2966Contract.Ensures(Contract.Result<String>() != null);
2971Contract.Ensures(Contract.Result<String>() != null);
2982Contract.Ensures(Contract.Result<String>() != null);
2983Contract.EndContractBlock();
2989Contract.Ensures(Contract.Result<String>() != null);
2994Contract.Ensures(Contract.Result<String>() != null);
2999Contract.Ensures(Contract.Result<String>() != null);
3010Contract.Ensures(Contract.Result<String>() != null);
3011Contract.EndContractBlock();
3031Contract.Ensures(Contract.Result<String>() != null);
3032Contract.EndContractBlock();
3046Contract.Ensures(Contract.Result<String>() != null);
3047Contract.EndContractBlock();
3057Contract.Ensures(Contract.Result<String>() != null);
3058Contract.EndContractBlock();
3072Contract.Ensures(Contract.Result<String>() != null);
3073Contract.EndContractBlock();
3094Contract.Ensures(Contract.Result<String>() != null);
3095Contract.EndContractBlock();
3125Contract.Ensures(Contract.Result<String>() != null);
3126Contract.EndContractBlock();
3148Contract.Ensures(Contract.Result<String>() != null);
3149Contract.EndContractBlock();
3171Contract.Ensures(Contract.Result<String>() != null);
3172Contract.EndContractBlock();
3188Contract.Ensures(Contract.Result<String>() != null);
3189Contract.Ensures(Contract.Result<String>().Length ==
3192Contract.EndContractBlock();
3217Contract.Ensures(Contract.Result<String>() != null);
3218Contract.Ensures(Contract.Result<String>().Length ==
3222Contract.EndContractBlock();
3252Contract.Ensures(Contract.Result<String>() != null);
3253Contract.Ensures(Contract.Result<String>().Length ==
3258Contract.EndContractBlock();
3297Contract.Assert((currPos <= totalLength - values[i].Length),
3310Contract.Ensures(Contract.Result<String>() != null);
3312Contract.EndContractBlock();
3336Contract.Ensures(Contract.Result<String>().Length == str.Length);
3337Contract.Ensures(str.Equals(Contract.Result<String>()));
3338Contract.EndContractBlock();
3349Contract.Ensures(Contract.Result<String>() == null || Contract.Result<String>().Length == str.Length);
3350Contract.EndContractBlock();
3464Contract.Ensures(Contract.Result<CharEnumerator>() != null);
3465Contract.EndContractBlock();
3472Contract.Ensures(Contract.Result<IEnumerator<char>>() != null);
3473Contract.EndContractBlock();
3480Contract.Ensures(Contract.Result<IEnumerator>() != null);
3481Contract.EndContractBlock();
system\text\asciiencoding.cs (43)
74Contract.EndContractBlock();
96Contract.EndContractBlock();
119Contract.EndContractBlock();
149Contract.EndContractBlock();
197Contract.EndContractBlock();
234Contract.EndContractBlock();
262Contract.EndContractBlock();
290Contract.EndContractBlock();
320Contract.EndContractBlock();
357Contract.EndContractBlock();
386Contract.EndContractBlock();
407Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetByteCount]count is negative");
408Contract.Assert(chars != null, "[ASCIIEncoding.GetByteCount]chars is null");
411Contract.Assert(encoderFallback != null, "[ASCIIEncoding.GetByteCount]Attempting to use null fallback encoder");
425Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver),
444Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
481Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ASCIIEncoding.GetByteCount]leftover character should be high surrogate");
482Contract.Assert(encoder != null, "[ASCIIEncoding.GetByteCount]Expected encoder");
532Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
543Contract.Assert(bytes != null, "[ASCIIEncoding.GetBytes]bytes is null");
544Contract.Assert(byteCount >= 0, "[ASCIIEncoding.GetBytes]byteCount is negative");
545Contract.Assert(chars != null, "[ASCIIEncoding.GetBytes]chars is null");
546Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetBytes]charCount is negative");
549Contract.Assert(encoderFallback != null, "[ASCIIEncoding.GetBytes]Attempting to use null encoder fallback");
581Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver),
585Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
664Contract.Assert(encoder != null,
718Contract.Assert(chars > charStart || bytes == byteStart,
747Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 ||
759Contract.Assert(bytes != null, "[ASCIIEncoding.GetCharCount]bytes is null");
760Contract.Assert(count >= 0, "[ASCIIEncoding.GetCharCount]byteCount is negative");
770Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer ||
821Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
833Contract.Assert(bytes != null, "[ASCIIEncoding.GetChars]bytes is null");
834Contract.Assert(byteCount >= 0, "[ASCIIEncoding.GetChars]byteCount is negative");
835Contract.Assert(chars != null, "[ASCIIEncoding.GetChars]chars is null");
836Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetChars]charCount is negative");
853Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer ||
921Contract.Assert(bytes > byteStart || chars == charStart,
934Contract.Assert(bytes > byteStart || chars == charStart,
951Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
963Contract.EndContractBlock();
984Contract.EndContractBlock();
system\text\dbcscodepageencoding.cs (40)
65Contract.Assert(false, "Didn't expect to make it to DBCSCodePageEncoding serialization constructor");
101Contract.Assert(pCodePage->CodePage == this.dataTableCodePage,
124Contract.Assert(bytesUnknown == 0x3f,
138Contract.Assert(((*mapCodePageCached == this.dataTableCodePage && this.bFlagDataTable) ||
192Contract.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100");
411Contract.Assert((arrayTemp.Length / 2) < 20,
542Contract.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative");
543Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null");
546Contract.Assert(encoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback");
572Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate");
573Contract.Assert(encoder != null,
634Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null");
635Contract.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative");
636Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null");
637Contract.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative");
640Contract.Assert(encoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback");
658Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver),
673Contract.Assert(encoder != null,
706Contract.Assert(encoder == null,
728Contract.Assert(chars > charStart,
747Contract.Assert(chars > charStart,
787Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null");
788Contract.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative");
804Contract.Assert(decoder == null ||
822Contract.Assert(fallbackBuffer == null,
846Contract.Assert(fallbackBuffer == null,
921Contract.Assert(decoder == null || !decoder.m_throwOnOverflow ||
934Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null");
935Contract.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative");
936Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null");
937Contract.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative");
955Contract.Assert(decoder == null || !decoder.m_throwOnOverflow ||
974Contract.Assert(fallbackBuffer == null,
999Contract.Assert(fallbackBuffer == null,
1077Contract.Assert(bytes >= byteStart + byteBuffer.Length,
1091Contract.Assert(bytes > byteStart,
1096Contract.Assert(bytes > byteStart,
1122Contract.Assert(decoder == null || !decoder.m_throwOnOverflow ||
1135Contract.EndContractBlock();
1157Contract.EndContractBlock();
system\text\gb18030encoding.cs (19)
138Contract.Assert(info!=null, "[GB18030Encoding(Serialization...)] Expected null info to throw");
150Contract.Assert(info!=null, "[GB18030.GetObjectData] Expected null info to throw");
209Contract.Assert(count4Byte <= GBLast4ByteCode,
227Contract.Assert(unicodeCount == 0,
231Contract.Assert(count4Byte == GBLast4ByteCode + 1,
271Contract.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative");
272Contract.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null");
273Contract.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative");
276Contract.Assert(encoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback");
299Contract.Assert(Char.IsHighSurrogate(charLeftOver),
329Contract.Assert(offset < 0x6f,
379Contract.Assert(iBytes < 0x7e,
459Contract.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null");
460Contract.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative");
462Contract.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative");
805Contract.EndContractBlock();
827Contract.EndContractBlock();
867Contract.EndContractBlock();
895Contract.EndContractBlock();
system\text\isciiencoding.cs (36)
77Contract.Assert(defaultCodePage >= CodeDevanagari && defaultCodePage <= CodePunjabi,
91Contract.Assert(false, "Didn't expect to make it to ISCIIEncoding serialization constructor");
102Contract.Assert(info!=null, "[ISCIIEncoding.GetObjectData] Expected null info to throw");
120Contract.EndContractBlock();
144Contract.EndContractBlock();
175Contract.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null");
177Contract.Assert(charCount >=0, "[ISCIIEncoding.GetBytes]charCount >=0");
178Contract.Assert(byteCount >=0, "[ISCIIEncoding.GetBytes]byteCount >=0");
275Contract.Assert(indicScript!=0, "[ISCIIEncoding.GetBytes]expected an indic script value");
286Contract.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi,
301Contract.Assert((indicTwoBytes >> 12) > 0 && (indicTwoBytes >> 12) <= 3,
367Contract.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null");
368Contract.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative");
370Contract.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative");
402Contract.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi,
422Contract.Assert(((bLastVirama ? 1 : 0) + (bLastATR ? 1 : 0) +
483Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode");
484Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode");
485Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode");
486Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode");
515Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode");
516Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode");
517Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode");
518Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode");
551Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode");
552Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode");
553Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode");
554Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode");
559Contract.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0,
581Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode");
582Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode");
583Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode");
588Contract.Assert (!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR &&
607Contract.Assert (currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1");
653Contract.Assert(currentCodePage == CodeDevanagari && b == DevenagariExt,
708Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
system\text\iso2022encoding.cs (28)
77Contract.Assert(false, "Didn't expect to make it to DBCSCodePageEncoding serialization constructor");
135Contract.Assert(false, "[ISO2022Encoding.GetMemorySectionName] Don't expect to get here for code page " + this.CodePage);
279Contract.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative");
280Contract.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null");
291Contract.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null");
292Contract.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative");
293Contract.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative");
296Contract.Assert(encoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback");
332Contract.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null");
333Contract.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative");
344Contract.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null");
345Contract.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative");
346Contract.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative");
370Contract.Assert(false, "[ISO2022Encoding.GetChars] had unexpected code page");
434Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate");
495Contract.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221");
677Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate");
777Contract.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow,
825Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate");
1151Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
1245Contract.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0");
1453Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
1512Contract.Assert(byteCount >=0, "[ISO2022Encoding.GetCharsCP52936]count >=0");
1513Contract.Assert(bytes!=null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null");
1624Contract.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ");
1749Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
1768Contract.EndContractBlock();
1823Contract.EndContractBlock();
system\text\latin1encoding.cs (28)
50Contract.Assert(info!=null, "[Latin1Encoding.GetObjectData] Expected null info to throw");
68Contract.Assert(charCount >= 0, "[Latin1Encoding.GetByteCount]count is negative");
69Contract.Assert(chars != null, "[Latin1Encoding.GetByteCount]chars is null");
72Contract.Assert(encoderFallback != null, "[Latin1Encoding.GetByteCount]Attempting to use null fallback encoder");
82Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver),
88Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
125Contract.Assert(encoder != null,
174Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
185Contract.Assert(bytes != null, "[Latin1Encoding.GetBytes]bytes is null");
186Contract.Assert(byteCount >= 0, "[Latin1Encoding.GetBytes]byteCount is negative");
187Contract.Assert(chars != null, "[Latin1Encoding.GetBytes]chars is null");
188Contract.Assert(charCount >= 0, "[Latin1Encoding.GetBytes]charCount is negative");
191Contract.Assert(encoderFallback != null, "[Latin1Encoding.GetBytes]Attempting to use null encoder fallback");
200Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver),
204Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
287Contract.Assert(encoder != null,
341Contract.Assert(chars > charStart,
359Contract.Assert(fallbackBuffer == null || fallbackBuffer.bFallingBack == false,
363Contract.Assert(chars > charStart,
388Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
399Contract.Assert(bytes != null, "[Latin1Encoding.GetCharCount]bytes is null");
400Contract.Assert(count >= 0, "[Latin1Encoding.GetCharCount]byteCount is negative");
412Contract.Assert(bytes != null, "[Latin1Encoding.GetChars]bytes is null");
413Contract.Assert(byteCount >= 0, "[Latin1Encoding.GetChars]byteCount is negative");
414Contract.Assert(chars != null, "[Latin1Encoding.GetChars]chars is null");
415Contract.Assert(charCount >= 0, "[Latin1Encoding.GetChars]charCount is negative");
451Contract.EndContractBlock();
471Contract.EndContractBlock();
system\text\sbcscodepageencoding.cs (38)
57Contract.Assert(false, "Didn't expect to make it to SBCSCodePageEncoding serialization constructor");
77Contract.Assert(pCodePage->CodePage == this.dataTableCodePage,
100Contract.Assert(*mapCodePageCached == this.dataTableCodePage,
184Contract.Assert(arrayTemp[byteTemp] == UNKNOWN_CHAR, String.Format(CultureInfo.InvariantCulture,
285Contract.Assert(arrayTemp[iBestFitCount-1] != (char)0,
307Contract.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative");
308Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null");
311Contract.Assert(encoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback");
323Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver),
328Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
367Contract.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver");
418Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
429Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null");
430Contract.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative");
431Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null");
432Contract.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative");
435Contract.Assert(encoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback");
447Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver),
452Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
549Contract.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver");
602Contract.Assert(chars > charStart,
619Contract.Assert(fallbackBuffer == null || fallbackBuffer.bFallingBack == false,
623Contract.Assert(chars > charStart,
649Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
660Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null");
661Contract.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative");
680Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer ||
733Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
745Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null");
746Contract.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative");
747Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null");
748Contract.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative");
772Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer ||
852Contract.Assert(bytes > byteStart,
870Contract.Assert(bytes > byteStart,
887Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
898Contract.EndContractBlock();
918Contract.EndContractBlock();
system\text\stringbuilder.cs (159)
131Contract.EndContractBlock();
168Contract.EndContractBlock();
183Contract.EndContractBlock();
248Contract.EndContractBlock();
267Contract.Assert(currentBlock.m_MaxCapacity == maxCapacity, "Bad maxCapacity");
268Contract.Assert(currentBlock.m_ChunkChars != null, "Empty Buffer");
270Contract.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length, "Out of range length");
271Contract.Assert(currentBlock.m_ChunkLength >= 0, "Negative length");
272Contract.Assert(currentBlock.m_ChunkOffset >= 0, "Negative offset");
277Contract.Assert(currentBlock.m_ChunkOffset == 0, "First chunk's offset is not 0");
281Contract.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength, "There is a gap between chunks!");
298Contract.EndContractBlock();
322Contract.EndContractBlock();
331Contract.Ensures(Contract.Result<String>() != null);
374Contract.Ensures(Contract.Result<String>() != null);
458Contract.Ensures(Contract.Result<int>() >= 0);
470Contract.EndContractBlock();
478Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity");
500Contract.Assert(newLen > chunk.m_ChunkChars.Length, "the new chunk should be larger than the one it is replacing");
510Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity");
558Contract.Ensures(Contract.Result<StringBuilder>() != null);
559Contract.EndContractBlock();
576Contract.Assert(m_ChunkLength == 0, "Expand should create a new block");
601Contract.Ensures(Contract.Result<StringBuilder>() != null);
602Contract.EndContractBlock();
635Contract.Ensures(Contract.Result<StringBuilder>() != null);
708Contract.Ensures(Contract.Result<StringBuilder>() != null);
743Contract.Ensures(Contract.Result<StringBuilder>() != null);
749Contract.Ensures(Contract.Result<StringBuilder>() != null);
781Contract.EndContractBlock();
824Contract.Ensures(Contract.Result<StringBuilder>() != null);
825Contract.EndContractBlock();
844Contract.Assert(insertingChars + this.Length < Int32.MaxValue);
877Contract.Ensures(Contract.Result<StringBuilder>() != null);
878Contract.EndContractBlock();
906Contract.Ensures(Contract.Result<StringBuilder>() != null);
914Contract.Ensures(Contract.Result<StringBuilder>() != null);
921Contract.Ensures(Contract.Result<StringBuilder>() != null);
927Contract.Ensures(Contract.Result<StringBuilder>() != null);
939Contract.Ensures(Contract.Result<StringBuilder>() != null);
946Contract.Ensures(Contract.Result<StringBuilder>() != null);
953Contract.Ensures(Contract.Result<StringBuilder>() != null);
960Contract.Ensures(Contract.Result<StringBuilder>() != null);
967Contract.Ensures(Contract.Result<StringBuilder>() != null);
972Contract.Ensures(Contract.Result<StringBuilder>() != null);
980Contract.Ensures(Contract.Result<StringBuilder>() != null);
988Contract.Ensures(Contract.Result<StringBuilder>() != null);
996Contract.Ensures(Contract.Result<StringBuilder>() != null);
1003Contract.Ensures(Contract.Result<StringBuilder>() != null);
1015Contract.Ensures(Contract.Result<StringBuilder>() != null);
1041Contract.Ensures(Contract.Result<StringBuilder>() != null);
1042Contract.EndContractBlock();
1060Contract.Ensures(Contract.Result<StringBuilder>() != null);
1071Contract.Ensures(Contract.Result<StringBuilder>() != null);
1081Contract.Ensures(Contract.Result<StringBuilder>() != null);
1091Contract.Ensures(Contract.Result<StringBuilder>() != null);
1101Contract.Ensures(Contract.Result<StringBuilder>() != null);
1118Contract.Ensures(Contract.Result<StringBuilder>() != null);
1119Contract.EndContractBlock();
1132Contract.Ensures(Contract.Result<StringBuilder>() != null);
1177Contract.Ensures(Contract.Result<StringBuilder>() != null);
1187Contract.Ensures(Contract.Result<StringBuilder>() != null);
1197Contract.Ensures(Contract.Result<StringBuilder>() != null);
1207Contract.Ensures(Contract.Result<StringBuilder>() != null);
1212Contract.Ensures(Contract.Result<StringBuilder>() != null);
1222Contract.Ensures(Contract.Result<StringBuilder>() != null);
1232Contract.Ensures(Contract.Result<StringBuilder>() != null);
1242Contract.Ensures(Contract.Result<StringBuilder>() != null);
1252Contract.Ensures(Contract.Result<StringBuilder>() != null);
1263Contract.Ensures(Contract.Result<StringBuilder>() != null);
1268Contract.Ensures(Contract.Result<StringBuilder>() != null);
1273Contract.Ensures(Contract.Result<StringBuilder>() != null);
1284Contract.Ensures(Contract.Result<String>() != null);
1285Contract.EndContractBlock();
1291Contract.Ensures(Contract.Result<StringBuilder>() != null);
1296Contract.Ensures(Contract.Result<StringBuilder>() != null);
1301Contract.Ensures(Contract.Result<StringBuilder>() != null);
1312Contract.Ensures(Contract.Result<String>() != null);
1313Contract.EndContractBlock();
1326Contract.Ensures(Contract.Result<StringBuilder>() != null);
1327Contract.EndContractBlock();
1486Contract.Ensures(Contract.Result<StringBuilder>() != null);
1537Contract.Ensures(Contract.Result<StringBuilder>() != null);
1608Contract.Assert(chunk != null || count == 0, "Chunks ended prematurely");
1624Contract.Ensures(Contract.Result<StringBuilder>() != null);
1692Contract.Assert(m_ChunkLength == 0, "Expand did not make a new block");
1758Contract.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen");
1759Contract.Assert(gapStart <= gapEnd, "negative gap size");
1760Contract.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big");
1770Contract.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk");
1823Contract.Assert(lengthInChunk >= 0, "index not in chunk");
1917Contract.Assert(0 <= index && index <= Length, "index not in string");
1923Contract.Assert(ret != null, "index not in string");
1934Contract.Assert(0 <= byteIndex && byteIndex <= Length*sizeof(char), "Byte Index not in string");
1940Contract.Assert(ret != null, "Byte Index not in string");
1964Contract.Requires(Capacity == Length, "Expand expect to be called only when there is no space left"); // We are currently full
1965Contract.Requires(minBlockCharCount > 0, "Expansion request must be positive");
2027Contract.Assert(count > 0, "Count must be strictly positive");
2028Contract.Assert(index >= 0, "Index can't be negative");
2094Contract.Assert(size > 0, "size not positive");
2095Contract.Assert(maxCapacity > 0, "maxCapacity not positive");
2112Contract.Assert(startIndex >= 0 && startIndex < Length, "startIndex not in string");
2141Contract.Assert(chunk != null, "fell off beginning of string!");
2171Contract.Assert(chunk != null, "fell off beginning of string!");
system\text\unicodeencoding.cs (47)
111Contract.EndContractBlock();
133Contract.EndContractBlock();
156Contract.EndContractBlock();
186Contract.EndContractBlock();
234Contract.EndContractBlock();
271Contract.EndContractBlock();
299Contract.EndContractBlock();
327Contract.EndContractBlock();
357Contract.EndContractBlock();
394Contract.EndContractBlock();
423Contract.EndContractBlock();
440Contract.Assert(chars!=null, "[UnicodeEncoding.GetByteCount]chars!=null");
441Contract.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0");
590Contract.Assert(chars > charStart,
657Contract.Assert(chars > charStart,
723Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
734Contract.Assert(chars!=null, "[UnicodeEncoding.GetBytes]chars!=null");
735Contract.Assert(byteCount >=0, "[UnicodeEncoding.GetBytes]byteCount >=0");
736Contract.Assert(charCount >=0, "[UnicodeEncoding.GetBytes]charCount >=0");
737Contract.Assert(bytes!=null, "[UnicodeEncoding.GetBytes]bytes!=null");
941Contract.Assert(chars > charStart,
1007Contract.Assert(chars > charStart + 1 || bytes == byteStart,
1036Contract.Assert(chars > charStart,
1070Contract.Assert(chars > charStart,
1138Contract.Assert((encoder != null && !encoder.MustFlush) || charLeftOver == (char)0,
1141Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 ||
1154Contract.Assert(bytes!=null, "[UnicodeEncoding.GetCharCount]bytes!=null");
1155Contract.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0");
1194Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0,
1484Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
1494Contract.Assert(chars!=null, "[UnicodeEncoding.GetChars]chars!=null");
1495Contract.Assert(byteCount >=0, "[UnicodeEncoding.GetChars]byteCount >=0");
1496Contract.Assert(charCount >=0, "[UnicodeEncoding.GetChars]charCount >=0");
1497Contract.Assert(bytes!=null, "[UnicodeEncoding.GetChars]bytes!=null");
1513Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0,
1671Contract.Assert(bytes >= byteStart + 2 || chars == charStart,
1720Contract.Assert(bytes >= byteStart + 2 || chars == charStart,
1737Contract.Assert(bytes >= byteStart + 2 || chars == charStart,
1779Contract.Assert(bytes >= byteStart + 2 || chars == charStart,
1796Contract.Assert(bytes >= byteStart + 2 || chars == charStart,
1841Contract.Assert(bytes >= byteStart + 2 || chars == charStart,
1894Contract.Assert((decoder.MustFlush == false) || ((lastChar == (char)0) && (lastByte == -1)),
1909Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
1949Contract.EndContractBlock();
1972Contract.EndContractBlock();
2032Contract.EndContractBlock();
2059Contract.EndContractBlock();
system\text\utf32encoding.cs (38)
115Contract.EndContractBlock();
137Contract.EndContractBlock();
159Contract.EndContractBlock();
189Contract.EndContractBlock();
237Contract.EndContractBlock();
273Contract.EndContractBlock();
301Contract.EndContractBlock();
328Contract.EndContractBlock();
358Contract.EndContractBlock();
394Contract.EndContractBlock();
422Contract.EndContractBlock();
439Contract.Assert(chars!=null, "[UTF32Encoding.GetByteCount]chars!=null");
440Contract.Assert(count >=0, "[UTF32Encoding.GetByteCount]count >=0");
502Contract.Assert(chars > charStart,
555Contract.Assert(fallbackBuffer.Remaining == 0,
566Contract.Assert(chars!=null, "[UTF32Encoding.GetBytes]chars!=null");
567Contract.Assert(bytes!=null, "[UTF32Encoding.GetBytes]bytes!=null");
568Contract.Assert(byteCount >=0, "[UTF32Encoding.GetBytes]byteCount >=0");
569Contract.Assert(charCount >=0, "[UTF32Encoding.GetBytes]charCount >=0");
638Contract.Assert(chars > charStart + 1 || bytes == byteStart,
666Contract.Assert(chars > charStart,
707Contract.Assert(chars > charStart,
741Contract.Assert(highSurrogate == 0 || (encoder != null && !encoder.MustFlush),
760Contract.Assert(bytes!=null, "[UTF32Encoding.GetCharCount]bytes!=null");
761Contract.Assert(count >=0, "[UTF32Encoding.GetCharCount]count >=0");
786Contract.Assert(fallbackBuffer.Remaining == 0,
893Contract.Assert(fallbackBuffer.Remaining == 0,
904Contract.Assert(chars!=null, "[UTF32Encoding.GetChars]chars!=null");
905Contract.Assert(bytes!=null, "[UTF32Encoding.GetChars]bytes!=null");
906Contract.Assert(byteCount >=0, "[UTF32Encoding.GetChars]byteCount >=0");
907Contract.Assert(charCount >=0, "[UTF32Encoding.GetChars]charCount >=0");
934Contract.Assert(fallbackBuffer.Remaining == 0,
995Contract.Assert(bytes >= byteStart + 4 || chars == charStart,
1019Contract.Assert(bytes >= byteStart + 4 || chars == charStart,
1036Contract.Assert(bytes >= byteStart + 4 || chars == charStart,
1100Contract.Assert(fallbackBuffer.Remaining == 0,
1141Contract.EndContractBlock();
1164Contract.EndContractBlock();
system\text\utf7encoding.cs (31)
179Contract.EndContractBlock();
202Contract.EndContractBlock();
225Contract.EndContractBlock();
256Contract.EndContractBlock();
304Contract.EndContractBlock();
341Contract.EndContractBlock();
369Contract.EndContractBlock();
397Contract.EndContractBlock();
427Contract.EndContractBlock();
464Contract.EndContractBlock();
493Contract.EndContractBlock();
510Contract.Assert(chars!=null, "[UTF7Encoding.GetByteCount]chars!=null");
511Contract.Assert(count >=0, "[UTF7Encoding.GetByteCount]count >=0");
521Contract.Assert(byteCount >=0, "[UTF7Encoding.GetBytes]byteCount >=0");
522Contract.Assert(chars!=null, "[UTF7Encoding.GetBytes]chars!=null");
523Contract.Assert(charCount >=0, "[UTF7Encoding.GetBytes]charCount >=0");
661Contract.Assert(count >=0, "[UTF7Encoding.GetCharCount]count >=0");
662Contract.Assert(bytes!=null, "[UTF7Encoding.GetCharCount]bytes!=null");
672Contract.Assert(byteCount >=0, "[UTF7Encoding.GetChars]byteCount >=0");
673Contract.Assert(bytes!=null, "[UTF7Encoding.GetChars]bytes!=null");
674Contract.Assert(charCount >=0, "[UTF7Encoding.GetChars]charCount >=0");
693Contract.Assert(firstByte == false || decoder.bitCount <= 0,
854Contract.EndContractBlock();
887Contract.EndContractBlock();
916Contract.EndContractBlock();
932Contract.EndContractBlock();
981Contract.EndContractBlock();
996Contract.EndContractBlock();
1080Contract.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks");
1081Contract.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte");
1141Contract.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
system\text\utf8encoding.cs (49)
143Contract.EndContractBlock();
165Contract.EndContractBlock();
188Contract.EndContractBlock();
218Contract.EndContractBlock();
266Contract.EndContractBlock();
303Contract.EndContractBlock();
331Contract.EndContractBlock();
359Contract.EndContractBlock();
389Contract.EndContractBlock();
426Contract.EndContractBlock();
455Contract.EndContractBlock();
516Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF,
548Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF,
819Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
852Contract.Assert(chars!=null, "[UTF8Encoding.GetBytes]chars!=null");
853Contract.Assert(byteCount >=0, "[UTF8Encoding.GetBytes]byteCount >=0");
854Contract.Assert(charCount >=0, "[UTF8Encoding.GetBytes]charCount >=0");
855Contract.Assert(bytes!=null, "[UTF8Encoding.GetBytes]bytes!=null");
904Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF,
932Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF,
1029Contract.Assert(pSrc >= chars || pTarget == bytes,
1251Contract.Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetBytes]pTarget <= pAllocatedBufferEnd");
1262Contract.Assert(!encoder.MustFlush || ch == 0,
1269Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 ||
1294Contract.Assert(count >=0, "[UTF8Encoding.GetCharCount]count >=0");
1295Contract.Assert(bytes!=null, "[UTF8Encoding.GetCharCount]bytes!=null");
1314Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0,
1349Contract.Assert( (ch & (SupplimentarySeq | ThreeByteSeq)) != 0,
1670Contract.Assert(fallback == null || fallback.Remaining == 0,
1690Contract.Assert(chars!=null, "[UTF8Encoding.GetChars]chars!=null");
1691Contract.Assert(byteCount >=0, "[UTF8Encoding.GetChars]count >=0");
1692Contract.Assert(charCount >=0, "[UTF8Encoding.GetChars]charCount >=0");
1693Contract.Assert(bytes!=null, "[UTF8Encoding.GetChars]bytes!=null");
1710Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0,
1745Contract.Assert( (ch & (SupplimentarySeq | ThreeByteSeq)) != 0,
1808Contract.Assert(pSrc >= bytes || pTarget == chars,
1815Contract.Assert(pSrc >= bytes,
1901Contract.Assert(pSrc >= bytes || pTarget == chars,
2155Contract.Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetChars]pTarget <= pAllocatedBufferEnd");
2182Contract.Assert(pSrc >= bytes || pTarget == chars,
2190Contract.Assert(pSrc >= bytes,
2201Contract.Assert(!baseDecoder.MustFlush || ch == 0 || !baseDecoder.m_throwOnOverflow,
2212Contract.Assert(fallback == null || fallback.Remaining == 0,
2349Contract.EndContractBlock();
2372Contract.EndContractBlock();
2437Contract.EndContractBlock();
2462Contract.EndContractBlock();
2512Contract.EndContractBlock();
2538Contract.EndContractBlock();
system\threading\SemaphoreSlim.cs (14)
96Contract.Assert(setSuccessfully, "Should have been able to complete task");
368Contract.Assert(m_asyncTail != null, "tail should not be null if head isn't");
400Contract.Assert(!waitSuccessful || m_currentCount > 0,
629Contract.Assert(m_currentCount == 0, "m_currentCount should never be negative");
642Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held");
650Contract.Assert(m_asyncTail == null, "If head is null, so too should be tail");
656Contract.Assert(m_asyncTail != null, "If head is not null, neither should be tail");
671Contract.Requires(task != null, "Expected non-null task");
672Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held");
682Contract.Assert((m_asyncHead == null) == (m_asyncTail == null), "Head is null iff tail is null");
697Contract.Assert(asyncWaiter != null, "Waiter should have been constructed");
698Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held");
805Contract.Assert(m_asyncTail != null, "tail should not be null if head isn't null");
889Contract.Assert(semaphore != null, "Expected a SemaphoreSlim");
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (26)
110Contract.EndContractBlock();
207Contract.Requires(ReadyToComplete, "The block must be ready to complete to be here.");
219Contract.Assert(!localCs.Task.IsCompleted, "Completion should only happen once.");
225Contract.Assert(success, "Expected to complete completion task.");
234Contract.Requires(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception.InnerExceptions.Count > 0,
342else Contract.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0.");
351Contract.Requires(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode.");
352Contract.Requires(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed.");
357Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId),
378Contract.Assert(currentMode == ProcessingMode.ProcessingExclusiveTask,
388Contract.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive.");
401Contract.Requires(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode.");
406Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId),
438Contract.Assert(currentMode == ProcessingMode.ProcessingConcurrentTasks,
448Contract.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent.");
509Contract.Requires(pair != null, "Scheduler must be associated with a valid pair.");
510Contract.Requires(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask,
512Contract.Requires(
533Contract.Assert(task != null, "Infrastructure should have provided a non-null task.");
550Contract.Assert(task != null, "Infrastructure should have provided a non-null task.");
561Contract.Assert(task != null, "Infrastructure should have provided a non-null task.");
634Contract.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception.");
674Contract.Requires(scheduler != null, "Need a scheduler with which to construct the debug view.");
697Contract.Requires(pair != null, "Need a pair with which to construct the debug view.");
740Contract.Requires(syncObj != null, "The monitor object to check must be provided.");
758Contract.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
system\threading\Tasks\FutureFactory.cs (48)
540Contract.Requires((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null");
699Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
703Contract.EndContractBlock();
822Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
853Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
959Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
989Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1104Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
1134Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1256Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
1286Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1336Contract.Assert(thisRef != null, "Expected a non-null thisRef");
1337Contract.Assert(beginMethod != null, "Expected a non-null beginMethod");
1338Contract.Assert(endMethod != null, "Expected a non-null endMethod");
1351Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1379Contract.Requires(thisRef != null, "Expected a non-null thisRef");
1380Contract.Requires(endMethod != null, "Expected a non-null endMethod");
1394Contract.EndContractBlock();
1431Contract.Assert(!IsCompleted, "The task should not have been completed yet.");
1460Contract.Assert(successfullySet, "Expected the task to not yet be completed");
1498Contract.EndContractBlock();
1529Contract.EndContractBlock();
1566Contract.EndContractBlock();
1614Contract.EndContractBlock();
1641Contract.EndContractBlock();
1674Contract.EndContractBlock();
1713Contract.EndContractBlock();
1762Contract.EndContractBlock();
1779Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
1781Contract.EndContractBlock();
1807Contract.Assert(continuationAction != null);
1826Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
1828Contract.EndContractBlock();
1860Contract.Assert(continuationAction != null);
1898Contract.EndContractBlock();
1929Contract.EndContractBlock();
1966Contract.EndContractBlock();
2014Contract.EndContractBlock();
2041Contract.EndContractBlock();
2074Contract.EndContractBlock();
2113Contract.EndContractBlock();
2162Contract.EndContractBlock();
2180Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
2182Contract.EndContractBlock();
2206Contract.Assert(continuationAction != null);
2227Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
2229Contract.EndContractBlock();
2252Contract.Assert(continuationAction != null);
system\threading\Tasks\Parallel.cs (19)
1042Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1,
1044Contract.Assert(bodyWithLocal != null || (localInit == null && localFinally == null),
1168Contract.Assert(sharedPStateFlags != null);
1173Contract.Assert(sharedPStateFlags != null);
1357Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1,
1359Contract.Assert(bodyWithLocal != null || (localInit == null && localFinally == null),
1482Contract.Assert(sharedPStateFlags != null);
1487Contract.Assert(sharedPStateFlags != null);
2225Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) +
2228Contract.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null),
2289Contract.Assert(array != null);
2290Contract.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null");
2348Contract.Assert(list != null);
2349Contract.Assert(parallelOptions != null, "ForEachWorker(list): parallelOptions is null");
3202Contract.Assert(((simpleBody == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) +
3205Contract.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null),
3209Contract.Assert((orderedSource != null) || (bodyWithStateAndIndex == null && bodyWithEverything == null),
3412Contract.Assert(false, "PartitionerForEach: illegal body type in Partitioner handler");
3587Contract.Assert(m_timeLimit != 0, "Probably the default initializer for LoopTimer was used somewhere");
system\threading\Tasks\ProducerConsumerQueues.cs (15)
147Contract.Assert(INIT_SEGMENT_SIZE > 0, "Initial segment size must be > 0.");
148Contract.Assert((INIT_SEGMENT_SIZE & (INIT_SEGMENT_SIZE - 1)) == 0, "Initial segment size must be a power of 2");
149Contract.Assert(INIT_SEGMENT_SIZE <= MAX_SEGMENT_SIZE, "Initial segment size should be <= maximum.");
150Contract.Assert(MAX_SEGMENT_SIZE < Int32.MaxValue / 2, "Max segment size * 2 must be < Int32.MaxValue, or else overflow could occur.");
180Contract.Requires(segment != null, "Expected a non-null segment.");
190Contract.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow.");
235Contract.Requires(segment != null, "Expected a non-null segment.");
236Contract.Requires(array != null, "Expected a non-null item array.");
293Contract.Requires(segment != null, "Expected a non-null segment.");
294Contract.Requires(array != null, "Expected a non-null item array.");
359Contract.Requires(segment != null, "Expected a non-null segment.");
360Contract.Requires(array != null, "Expected a non-null item array.");
463Contract.Assert(syncObj != null, "The syncObj parameter is null.");
485Contract.Requires((size & (size - 1)) == 0, "Size must be a power of 2");
524Contract.Requires(queue != null, "Expected a non-null queue.");
system\threading\Tasks\Task.cs (113)
230Contract.Requires(task != null, "Null Task objects can't be added to the ActiveTasks collection");
353Contract.Assert(promiseStyle, "Promise CTOR: promiseStyle was false");
565Contract.EndContractBlock();
630Contract.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags");
631Contract.Assert((((int)creationOptions) | OptionsMask) == OptionsMask, "TaskConstructorCore: options take too many bits");
658Contract.Assert((internalOptions &
751Contract.Assert(targetTask != null,
775Contract.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null,
803Contract.Assert((OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get");
853Contract.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0,
861Contract.Assert(success, "Tried to set enabled on completed Task");
898Contract.Assert(tasks != null, "Expected non-null array of tasks");
938Contract.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set.");
958Contract.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set.");
1003Contract.Assert(Task.InternalCurrent == this || this.IsSelfReplicatingRoot, "Task.AddNewChild(): Called from an external context");
1026Contract.Assert(Task.InternalCurrent == this, "Task.DisregardChild(): Called from an external context");
1029Contract.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2");
1165Contract.EndContractBlock();
1176Contract.Requires(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler");
1247Contract.Assert(
1264Contract.Assert((m_stateFlags & TASK_STATE_CANCELED) != 0, "Task.RunSynchronously: expected TASK_STATE_CANCELED to be set");
1286Contract.EndContractBlock();
1415Contract.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted");
1509Contract.Assert(m_contingentProperties == null, "Expected props to be null after checking and with needsProtection == false");
1914Contract.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected");
1915Contract.Assert((m_stateFlags & TASK_STATE_STARTED) == 0, "task has already started");
1969Contract.Assert(
1989Contract.Requires(exceptionObject != null, "Task.AddException: Expected a non-null exception object");
2000Contract.Requires(exceptionObject != null, "Task.AddException: Expected a non-null exception object");
2105Contract.Assert(m_contingentProperties != null); // ExceptionRecorded ==> m_contingentProperties != null
2124Contract.Assert(exceptionsAvailable, "Must only be used when the task has faulted with exceptions.");
2134Contract.Assert(IsCanceled, "Must only be used when the task has canceled.");
2147Contract.Requires(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true");
2370Contract.Requires(childTask != null);
2371Contract.Requires(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task");
2373Contract.Assert(childTask.m_parent == this, "ProcessChildCompletion should only be called for a child of this task");
2433Contract.Assert(task.IsCompleted, "Expected all tasks in list to be completed");
2437Contract.Assert(exceptionHolder != null);
2464Contract.Assert(!bTAEAddedToExceptionHolder || (m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null),
2859Contract.Assert(task != null, "expected a task object");
2870Contract.Assert(m_action != null, "Null action in InnerInvoke()");
2883Contract.Assert(false, "Invalid m_action in Task");
2908Contract.Requires(unhandledException != null);
2966Contract.Requires(continuationAction != null);
3019Contract.Assert(!flowExecutionContext, "We already determined we're not required to flow context.");
3159Contract.EndContractBlock();
3187Contract.Assert((m_stateFlags & TASK_STATE_FAULTED) == 0, "Task.Wait() completing when in Faulted state.");
3263Contract.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite);
3393Contract.Requires((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task");
3458Contract.Assert(!mustCleanup, "Possibly an invalid state transition call was made in InternalCancel()");
3500Contract.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task");
3501Contract.Assert(m_contingentProperties.m_cancellationToken == default(CancellationToken));
3541Contract.Assert((m_stateFlags & (TASK_STATE_CANCELED | TASK_STATE_COMPLETION_RESERVED)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved.");
3575Contract.Assert(this == Task.InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task");
3576Contract.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled");
3707Contract.Assert(currentContinuation is ITaskCompletionAction, "Expected continuation element to be Action, TaskContinuation, or ITaskContinuationAction");
3910Contract.EndContractBlock();
4112Contract.EndContractBlock();
4327Contract.EndContractBlock();
4546Contract.EndContractBlock();
4636Contract.Requires(continuationTask != null, "Task.ContinueWithCore(): null continuationTask");
4637Contract.Requires(scheduler != null, "Task.ContinueWithCore(): null scheduler");
4638Contract.Requires(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed");
4729Contract.Requires(tc != null, "Expected non-null tc object in AddTaskContinuationComplex");
4753Contract.Assert((list != null) || (m_continuationObject == s_taskCompletionSentinel),
4793Contract.Requires(tc != null);
5051Contract.EndContractBlock();
5157Contract.Assert(exceptions != null, "Should have seen at least one exception");
5182Contract.Assert(tasks != null, "Expected a non-null list of tasks");
5183Contract.Assert(tasks.Count > 0, "Expected at least one task");
5229Contract.Assert(count > 0, "Expected count > 0");
5236Contract.Assert(_count >= 0, "Count should never go below 0");
5246Contract.Requires(tasks != null);
5325Contract.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed");
5464Contract.EndContractBlock();
5496Contract.Assert(firstCompleted.Status == TaskStatus.RanToCompletion);
5498Contract.Assert(signaledTaskIndex >= 0);
5538Contract.EndContractBlock();
5542Contract.Assert(succeeded, "This should always succeed on a new task.");
5553Contract.EndContractBlock();
5573Contract.EndContractBlock();
5593Contract.EndContractBlock();
5597Contract.Assert(succeeded, "This should always succeed on a new task.");
5709Contract.EndContractBlock();
5760Contract.EndContractBlock();
5870Contract.EndContractBlock();
6050Contract.EndContractBlock();
6071Contract.Requires(tasks != null, "Expected a non-null tasks array");
6102Contract.Requires(tasks != null, "Expected a non-null task array");
6103Contract.Requires(tasks.Length > 0, "Expected a non-zero length task array");
6142Contract.Assert(task != null, "Constituent task in WhenAll should never be null");
6162Contract.Assert(observedExceptions.Count > 0, "Expected at least one exception");
6184Contract.Assert(m_count >= 0, "Count should never go below 0");
6302Contract.EndContractBlock();
6322Contract.Requires(tasks != null, "Expected a non-null tasks array");
6346Contract.Requires(tasks != null, "Expected a non-null task array");
6347Contract.Requires(tasks.Length > 0, "Expected a non-zero length task array");
6387Contract.Assert(task != null, "Constituent task in WhenAll should never be null");
6400Contract.Assert(task.Status == TaskStatus.RanToCompletion);
6412Contract.Assert(observedExceptions.Count > 0, "Expected at least one exception");
6434Contract.Assert(m_count >= 0, "Count should never go below 0");
6476Contract.EndContractBlock();
6511Contract.EndContractBlock();
6593Contract.Requires(outerTask != null);
6626Contract.Assert(continuationTask.m_action == null);
7051Contract.Assert(m_inliningDepth >= 0, "Inlining depth count should never go negative.");
7152Contract.Requires(outerTask != null, "Expected non-null outerTask");
7210Contract.Assert(result, "Expected TrySetFromTask from inner task to succeed");
7213Contract.Assert(false, "UnwrapPromise in illegal state");
7238Contract.Requires(task != null && task.IsCompleted, "Expected non-null, completed outer task");
7239Contract.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!");
7251Contract.Assert(result, "Expected TrySetFromTask from outer task to succeed");
7269Contract.Requires(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
system\threading\Tasks\TaskContinuation.cs (32)
37Contract.Requires(action is Action<Task> || action is Action<Task, object>,
51Contract.Assert(antecedent != null,
59Contract.Assert(m_action != null);
72Contract.Assert(false, "Invalid m_action in ContinuationTaskFromTask");
85Contract.Requires(function is Func<Task, TResult> || function is Func<Task, object, TResult>,
99Contract.Assert(antecedent != null,
107Contract.Assert(m_action != null);
120Contract.Assert(false, "Invalid m_action in ContinuationResultTaskFromTask");
133Contract.Requires(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object>,
147Contract.Assert(antecedent != null,
155Contract.Assert(m_action != null);
168Contract.Assert(false, "Invalid m_action in ContinuationTaskFromResultTask");
181Contract.Requires(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object, TResult>,
195Contract.Assert(antecedent != null,
203Contract.Assert(m_action != null);
216Contract.Assert(false, "Invalid m_action in ContinuationResultTaskFromResultTask");
244Contract.Requires(task != null);
245Contract.Assert(task.m_taskScheduler != null);
305Contract.Requires(task != null, "TaskContinuation ctor: task is null");
306Contract.Requires(scheduler != null, "TaskContinuation ctor: scheduler is null");
324Contract.Assert(completedTask != null);
325Contract.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed");
405Contract.Assert(context != null);
496Contract.Assert(scheduler != null);
559Contract.Requires(action != null);
575Contract.Requires(action != null);
590Contract.Requires(action != null);
591Contract.Requires(scheduler != null);
748Contract.Requires(callback != null);
749Contract.Assert(currentTask == Task.t_currentTask);
796Contract.Assert(currentTask == Task.t_currentTask);
865Contract.Assert(m_action != null);
system\threading\Tasks\TaskExceptionHolder.cs (14)
63Contract.Requires(task != null, "Expected a non-null task.");
189Contract.Requires(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject");
190Contract.Requires(
206Contract.Requires(exceptionObject != null, "Expected exceptionObject to be non-null.");
208Contract.Assert(m_cancellationException == null,
213Contract.Assert(m_faultExceptions == null,
227Contract.Assert(edi != null && edi.SourceException is OperationCanceledException,
243Contract.Requires(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject");
248else Contract.Assert(exceptions.Count > 0, "Expected existing exceptions list to have > 0 exceptions.");
376Contract.Assert(exceptions != null, "Expected an initialized list.");
377Contract.Assert(exceptions.Count > 0, "Expected at least one exception.");
406Contract.Assert(exceptions != null, "Expected an initialized list.");
407Contract.Assert(exceptions.Count > 0, "Expected at least one exception.");
422Contract.Assert(edi == null || edi.SourceException is OperationCanceledException,
System\Linq\Parallel\Channels\AsynchronousChannel.cs (17)
118Contract.Assert(chunkSize > 0, "chunk size must be greater than 0");
119Contract.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0");
291Contract.Assert(chunk != null);
292Contract.Assert(!m_done, "can't continue producing after the production is over");
296Contract.Assert(!IsFull, "expected a non-full buffer");
386Contract.Assert(1 <= m_producerChunkIndex && m_producerChunkIndex <= m_chunkSize);
413Contract.Assert(m_consumerChunk == null);
421Contract.Assert(m_consumerChunk != null, "consumer chunk is null");
422Contract.Assert(0 <= m_consumerChunkIndex && m_consumerChunkIndex < m_consumerChunk.Length, "chunk index out of bounds");
491Contract.Assert(m_consumerChunk == null);
499Contract.Assert(m_consumerChunk != null, "consumer chunk is null");
500Contract.Assert(0 <= m_consumerChunkIndex && m_consumerChunkIndex < m_consumerChunk.Length, "chunk index out of bounds");
592Contract.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here");
611Contract.Assert(!IsChunkBufferEmpty);
669Contract.Assert(m_done, "Expected channel to be done before disposing");
670Contract.Assert(m_producerEvent != null);
671Contract.Assert(m_consumerEvent != null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (41)
78Contract.Assert(source != null);
79Contract.Assert(partitionCount > 0);
86Contract.Assert(source != null);
145Contract.Assert(partitions.Length == partitionCount);
168Contract.Assert(source != null);
169Contract.Assert(partitionCount > 0);
245Contract.Assert(data != null, "data musn't be null");
246Contract.Assert(partitionCount > 0, "partitionCount must be positive");
247Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
248Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
249Contract.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1");
258Contract.Assert(sectionSize > 0);
288Contract.Assert(mutables != null);
289Contract.Assert(mutables.m_currentPositionInChunk >= mutables.m_currentChunkSize);
351Contract.Assert(data != null, "data musn't be null");
352Contract.Assert(partitionCount > 0, "partitionCount must be positive");
353Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
354Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
371Contract.Assert(m_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread");
423Contract.Assert(data != null, "data musn't be null");
424Contract.Assert(partitionCount > 0, "partitionCount must be positive");
425Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
426Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
427Contract.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1");
436Contract.Assert(sectionSize > 0);
466Contract.Assert(mutables != null);
467Contract.Assert(mutables.m_currentPositionInChunk >= mutables.m_currentChunkSize);
529Contract.Assert(data != null, "data musn't be null");
530Contract.Assert(partitionCount > 0, "partitionCount must be positive");
531Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
532Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
549Contract.Assert(m_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread");
616Contract.Assert(source != null);
617Contract.Assert(sourceSyncLock != null);
618Contract.Assert(currentIndex != null);
639Contract.Assert(mutables.m_chunkBuffer != null);
649Contract.Assert(m_source != null);
650Contract.Assert(chunkBuffer != null);
651Contract.Assert(mutables.m_currentChunkSize > 0);
652Contract.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length);
666Contract.Assert(0 <= mutables.m_nextChunkMaxSize && mutables.m_nextChunkMaxSize <= chunkBuffer.Length);
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (16)
85Contract.Assert(child != null, "child data source cannot be null");
86Contract.Assert(intermediateReduce != null, "need an intermediate reduce function");
87Contract.Assert(finalReduce != null, "need a final reduce function");
88Contract.Assert(resultSelector != null, "need a result selector function");
89Contract.Assert(Enum.IsDefined(typeof(QueryAggregationOptions), options), "enum out of valid range");
90Contract.Assert((options & QueryAggregationOptions.Associative) == QueryAggregationOptions.Associative, "expected an associative operator");
91Contract.Assert(typeof(TIntermediate) == typeof(TInput) || seedIsSpecified, "seed must be specified if TIntermediate differs from TInput");
112Contract.Assert(m_finalReduce != null);
113Contract.Assert(m_resultSelector != null);
220Contract.Assert(false, "This method should never be called. Associative aggregation can always be parallelized.");
258Contract.Assert(source != null);
259Contract.Assert(reduceOperator != null);
277Contract.Assert(m_reduceOperator != null);
278Contract.Assert(m_reduceOperator.m_intermediateReduce != null, "expected a compiled operator");
302Contract.Assert(typeof(TInput) == typeof(TIntermediate));
335Contract.Assert(m_source != null);