joern icon indicating copy to clipboard operation
joern copied to clipboard

[c#] Using Statements

Open DavidBakerEffendi opened this issue 1 year ago • 3 comments

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using example

var numbers = new List<int>();
using (StreamReader reader = File.OpenText("numbers.txt"))
{
    string line;
    while ((line = reader.ReadLine()) is not null)
    {
        if (int.TryParse(line, out int number))
        {
            numbers.Add(number);
        }
    }
}

DavidBakerEffendi avatar Dec 21 '23 08:12 DavidBakerEffendi

@pandurangpatil which PR solves this issue?

DavidBakerEffendi avatar Jan 30 '24 12:01 DavidBakerEffendi

Note this refers to a try-with-resources mechanism

DavidBakerEffendi avatar Jan 30 '24 12:01 DavidBakerEffendi

Oh my mistake. I realized this is the statement not the package import

tuxology avatar Jan 31 '24 21:01 tuxology