NEW YORK — A federal judge on Wednesday dismissed a class-action lawsuit filed on behalf of New York children that claimed McDonald's food caused them to suffer health problems including diabetes, high blood pressure and obesity.

"If consumers know (or reasonably should know) the potential ill health effects of eating at McDonald's, they cannot blame McDonald's if they, nonetheless, choose to satiate their appetite with a surfeit of supersized McDonald's products," U.S. District Judge Robert Sweet said in a 65-page ruling.

"One necessary element of any potentially viable claim must be that McDonald's products involve a danger that is not within the common knowledge of consumers. . . . Plaintiffs have failed to allege with any specificity that such a danger exists."

McDonald's spokesman Walt Riker said in a statement that "common sense has prevailed."