Skip to content

Commit 972f843

Browse files
committed
Update r# annotations to 2016.1
1 parent cf286b4 commit 972f843

File tree

1 file changed

+64
-20
lines changed

1 file changed

+64
-20
lines changed

Jetbrains.Annotations.cs

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
using System;
1+
/* MIT License
2+
3+
Copyright (c) 2016 JetBrains http://www.jetbrains.com
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE. */
22+
23+
using System;
224

325
#pragma warning disable 1591
426
// ReSharper disable UnusedMember.Global
@@ -91,11 +113,12 @@ internal sealed class StringFormatMethodAttribute : Attribute
91113
/// <param name="formatParameterName">
92114
/// Specifies which parameter of an annotated method should be treated as format-string
93115
/// </param>
94-
public StringFormatMethodAttribute(string formatParameterName)
116+
public StringFormatMethodAttribute([NotNull] string formatParameterName)
95117
{
96118
FormatParameterName = formatParameterName;
97119
}
98120

121+
[NotNull]
99122
public string FormatParameterName { get; private set; }
100123
}
101124

@@ -106,7 +129,7 @@ public StringFormatMethodAttribute(string formatParameterName)
106129
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]
107130
internal sealed class ValueProviderAttribute : Attribute
108131
{
109-
public ValueProviderAttribute(string name)
132+
public ValueProviderAttribute([NotNull] string name)
110133
{
111134
Name = name;
112135
}
@@ -171,11 +194,12 @@ internal sealed class InvokerParameterNameAttribute : Attribute { }
171194
internal sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
172195
{
173196
public NotifyPropertyChangedInvocatorAttribute() { }
174-
public NotifyPropertyChangedInvocatorAttribute(string parameterName)
197+
public NotifyPropertyChangedInvocatorAttribute([NotNull] string parameterName)
175198
{
176199
ParameterName = parameterName;
177200
}
178201

202+
[CanBeNull]
179203
public string ParameterName { get; private set; }
180204
}
181205

@@ -234,6 +258,7 @@ public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStat
234258
ForceFullStates = forceFullStates;
235259
}
236260

261+
[NotNull]
237262
public string Contract { get; private set; }
238263
public bool ForceFullStates { get; private set; }
239264
}
@@ -374,7 +399,7 @@ internal enum ImplicitUseKindFlags
374399
/// </summary>
375400
InstantiatedWithFixedConstructorSignature = 4,
376401
/// <summary>Indicates implicit instantiation of a type.</summary>
377-
InstantiatedNoFixedConstructorSignature = 8
402+
InstantiatedNoFixedConstructorSignature = 8,
378403
}
379404

380405
/// <summary>
@@ -405,6 +430,7 @@ public PublicAPIAttribute([NotNull] string comment)
405430
Comment = comment;
406431
}
407432

433+
[CanBeNull]
408434
public string Comment { get; private set; }
409435
}
410436

@@ -442,6 +468,7 @@ public MustUseReturnValueAttribute([NotNull] string justification)
442468
Justification = justification;
443469
}
444470

471+
[CanBeNull]
445472
public string Justification { get; private set; }
446473
}
447474

@@ -473,11 +500,12 @@ internal sealed class ProvidesContextAttribute : Attribute { }
473500
internal sealed class PathReferenceAttribute : Attribute
474501
{
475502
public PathReferenceAttribute() { }
476-
public PathReferenceAttribute([PathReference] string basePath)
503+
public PathReferenceAttribute([NotNull, PathReference] string basePath)
477504
{
478505
BasePath = basePath;
479506
}
480507

508+
[CanBeNull]
481509
public string BasePath { get; private set; }
482510
}
483511

@@ -564,33 +592,36 @@ internal sealed class MacroAttribute : Attribute
564592
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
565593
internal sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute
566594
{
567-
public AspMvcAreaMasterLocationFormatAttribute(string format)
595+
public AspMvcAreaMasterLocationFormatAttribute([NotNull] string format)
568596
{
569597
Format = format;
570598
}
571599

600+
[NotNull]
572601
public string Format { get; private set; }
573602
}
574603

575604
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
576605
internal sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute
577606
{
578-
public AspMvcAreaPartialViewLocationFormatAttribute(string format)
607+
public AspMvcAreaPartialViewLocationFormatAttribute([NotNull] string format)
579608
{
580609
Format = format;
581610
}
582611

612+
[NotNull]
583613
public string Format { get; private set; }
584614
}
585615

586616
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
587617
internal sealed class AspMvcAreaViewLocationFormatAttribute : Attribute
588618
{
589-
public AspMvcAreaViewLocationFormatAttribute(string format)
619+
public AspMvcAreaViewLocationFormatAttribute([NotNull] string format)
590620
{
591621
Format = format;
592622
}
593623

624+
[NotNull]
594625
public string Format { get; private set; }
595626
}
596627

@@ -608,22 +639,24 @@ public AspMvcMasterLocationFormatAttribute(string format)
608639
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
609640
internal sealed class AspMvcPartialViewLocationFormatAttribute : Attribute
610641
{
611-
public AspMvcPartialViewLocationFormatAttribute(string format)
642+
public AspMvcPartialViewLocationFormatAttribute([NotNull] string format)
612643
{
613644
Format = format;
614645
}
615646

647+
[NotNull]
616648
public string Format { get; private set; }
617649
}
618650

619651
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
620652
internal sealed class AspMvcViewLocationFormatAttribute : Attribute
621653
{
622-
public AspMvcViewLocationFormatAttribute(string format)
654+
public AspMvcViewLocationFormatAttribute([NotNull] string format)
623655
{
624656
Format = format;
625657
}
626658

659+
[NotNull]
627660
public string Format { get; private set; }
628661
}
629662

@@ -637,11 +670,12 @@ public AspMvcViewLocationFormatAttribute(string format)
637670
internal sealed class AspMvcActionAttribute : Attribute
638671
{
639672
public AspMvcActionAttribute() { }
640-
public AspMvcActionAttribute(string anonymousProperty)
673+
public AspMvcActionAttribute([NotNull] string anonymousProperty)
641674
{
642675
AnonymousProperty = anonymousProperty;
643676
}
644677

678+
[CanBeNull]
645679
public string AnonymousProperty { get; private set; }
646680
}
647681

@@ -654,11 +688,12 @@ public AspMvcActionAttribute(string anonymousProperty)
654688
internal sealed class AspMvcAreaAttribute : Attribute
655689
{
656690
public AspMvcAreaAttribute() { }
657-
public AspMvcAreaAttribute(string anonymousProperty)
691+
public AspMvcAreaAttribute([NotNull] string anonymousProperty)
658692
{
659693
AnonymousProperty = anonymousProperty;
660694
}
661695

696+
[CanBeNull]
662697
public string AnonymousProperty { get; private set; }
663698
}
664699

@@ -672,11 +707,12 @@ public AspMvcAreaAttribute(string anonymousProperty)
672707
internal sealed class AspMvcControllerAttribute : Attribute
673708
{
674709
public AspMvcControllerAttribute() { }
675-
public AspMvcControllerAttribute(string anonymousProperty)
710+
public AspMvcControllerAttribute([NotNull] string anonymousProperty)
676711
{
677712
AnonymousProperty = anonymousProperty;
678713
}
679714

715+
[CanBeNull]
680716
public string AnonymousProperty { get; private set; }
681717
}
682718

@@ -774,11 +810,12 @@ internal sealed class AspMvcActionSelectorAttribute : Attribute { }
774810
internal sealed class HtmlElementAttributesAttribute : Attribute
775811
{
776812
public HtmlElementAttributesAttribute() { }
777-
public HtmlElementAttributesAttribute(string name)
813+
public HtmlElementAttributesAttribute([NotNull] string name)
778814
{
779815
Name = name;
780816
}
781817

818+
[CanBeNull]
782819
public string Name { get; private set; }
783820
}
784821

@@ -867,7 +904,7 @@ internal enum AssertionConditionType
867904
/// <summary>Marked parameter should be evaluated to null value.</summary>
868905
IS_NULL = 2,
869906
/// <summary>Marked parameter should be evaluated to not null value.</summary>
870-
IS_NOT_NULL = 3
907+
IS_NOT_NULL = 3,
871908
}
872909

873910
/// <summary>
@@ -920,13 +957,15 @@ internal sealed class XamlItemBindingOfItemsControlAttribute : Attribute { }
920957
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
921958
internal sealed class AspChildControlTypeAttribute : Attribute
922959
{
923-
public AspChildControlTypeAttribute(string tagName, Type controlType)
960+
public AspChildControlTypeAttribute([NotNull] string tagName, [NotNull] Type controlType)
924961
{
925962
TagName = tagName;
926963
ControlType = controlType;
927964
}
928965

966+
[NotNull]
929967
public string TagName { get; private set; }
968+
[NotNull]
930969
public Type ControlType { get; private set; }
931970
}
932971

@@ -947,6 +986,7 @@ public AspRequiredAttributeAttribute([NotNull] string attribute)
947986
Attribute = attribute;
948987
}
949988

989+
[NotNull]
950990
public string Attribute { get; private set; }
951991
}
952992

@@ -964,35 +1004,39 @@ public AspTypePropertyAttribute(bool createConstructorReferences)
9641004
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
9651005
internal sealed class RazorImportNamespaceAttribute : Attribute
9661006
{
967-
public RazorImportNamespaceAttribute(string name)
1007+
public RazorImportNamespaceAttribute([NotNull] string name)
9681008
{
9691009
Name = name;
9701010
}
9711011

1012+
[NotNull]
9721013
public string Name { get; private set; }
9731014
}
9741015

9751016
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
9761017
internal sealed class RazorInjectionAttribute : Attribute
9771018
{
978-
public RazorInjectionAttribute(string type, string fieldName)
1019+
public RazorInjectionAttribute([NotNull] string type, [NotNull] string fieldName)
9791020
{
9801021
Type = type;
9811022
FieldName = fieldName;
9821023
}
9831024

1025+
[NotNull]
9841026
public string Type { get; private set; }
1027+
[NotNull]
9851028
public string FieldName { get; private set; }
9861029
}
9871030

9881031
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
9891032
internal sealed class RazorDirectiveAttribute : Attribute
9901033
{
991-
public RazorDirectiveAttribute(string directive)
1034+
public RazorDirectiveAttribute([NotNull] string directive)
9921035
{
9931036
Directive = directive;
9941037
}
9951038

1039+
[NotNull]
9961040
public string Directive { get; private set; }
9971041
}
9981042

0 commit comments

Comments
 (0)