This is a migrated thread and some comments may be shown as answers.

Bad Code Green

3 Answers 39 Views
Code Analysis
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 22 Sep 2010, 04:15 PM
Consider the following code...
foreach (XElement e in GetGroups(DataList))
{
  if (e.Attribute("Name") == PageName || e.Attribute("Name") == "Generic")
  {
    PopulateList(e, ListToPopulate);
  }
}
The first part of the if statement should show as an error as you can't  apply the operator "==" to System.Xml.Linq.XAttribute and String.

Apparently.
-- 
Stuart

3 Answers, 1 is accepted

Sort by
0
Dennis :: Dr. Code
Telerik team
answered on 01 Oct 2010, 10:39 AM
Hello Stuart Hemming,

This is a known issue. JC currently doesn't check == operator types extensively.


All the best,
Dennis :: Dr. Code
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Stuart Hemming
Top achievements
Rank 2
answered on 01 Oct 2010, 10:48 AM
Dear Dr Code,

Is that the equivalent of you telling me to take two aspirin and call back in the morning?

-- 
Stuart
0
Dennis :: Dr. Code
Telerik team
answered on 01 Oct 2010, 11:03 AM
Hi Stuart,

Basically we'll fix the headache, but have to fix the heart disease first. Seriously, the bad-code-greens go with less priority than other issues (good-code-reds, exceptions, crashes). Just to let you know that your particular issue is on our list.


Sincerely yours,
Dennis :: Dr. Code
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Code Analysis
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Dennis :: Dr. Code
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or