SCM

[#1011069] Missing instantiation of list

View Trackers | Bugs | Download .csv | Monitor

Date:
2011-08-16 14:19
Priority:
3
State:
Open
Submitted by:
Timwi Terby (timwi)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.11
Category:
Group:
Resolution:
None
Summary:
Missing instantiation of list

Detailed description
Npgsql.SqlGenerators.ScanExpression contains the following code:

List<ColumnExpression> _projectedColumns;
internal override IEnumerable<ColumnExpression> GetProjectedColumns()
{
if (_projectedColumns == null)
{
foreach (var property in _target.ElementType.Members.OfType<EdmProperty>())
{
_projectedColumns.Add(new ColumnExpression(new PropertyExpression(property), property.Name, property.TypeUsage));
}
}
return _projectedColumns;
}

This code generates a compiler warning:

Field 'Npgsql.SqlGenerators.ScanExpression._projectedColumns'
is never assigned to, and will always have its default value null

I believe that someone forgot to insert an instantiation there. I believe it should read

[...]
if (_projectedColumns == null)
{
_projectedColumns = new List<ColumnExpression>();
foreach (var property in [...]

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge