-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathUsefullNotes.txt
25 lines (23 loc) · 1.07 KB
/
UsefullNotes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1. Caret
Could be found at _provider.GetCaretOffset
2. Check for null-ness (CheckVariableNullAction) can change for Assert is not null!
private bool CanBeNull(ILocalVariableDeclaration localVariableDeclaration)
{
ICSharpControlFlowGraf controlFlowGraf = base.Provider.GetControlFlowGraf();
ICSharpControlFlowAnalysisResult result = base.Provider.InspectControlFlowGraf();
if (result == null)
{
return false;
}
ILocalVariable declaredElement = localVariableDeclaration.DeclaredElement;
IControlFlowElement position = Enumerable.FirstOrDefault<IControlFlowElement>(controlFlowGraf.AllElements, (Func<IControlFlowElement, bool>) (e => (e.SourceElement == localVariableDeclaration)));
if (position == null)
{
return false;
}
if (result.GetVariableStateAt(position, declaredElement) == CSharpControlFlowNullReferenceState.NOT_NULL)
{
return false;
}
return true;
}