The reaction of the city's mainstream media is the only thing wackier than U.S. District Court Judge William J. Martini's ruling last week that the NYPD's widespread spying on New Jersey Muslims did not violate their civil rights. Further, he ruled, whatever harm Muslims suffered was caused by The Associated Press, whose series on NYPD's spying received the Pulitzer Prize.

"Ray Kelly was right," headlined a Wall Street Journal editorial, of the former NYPD commissioner. "Put an asterisk next to the prizes for The Associated Press." The New York Post agreed in similar language ("Ray was right"), suggesting that, "Perhaps the AP should return the prize." Or as the Daily News put it: "For good measure, Martini blamed AP, not the police, for ruffling feelings."

Martini dismissed a suit on behalf of eight Muslims who claimed the surveillance programs were unconstitutional, justifying the spying on Muslim schools, mosques, restaurants and so-called "hot spots." In his decision, Martini wrote that, "The police could not have monitored New Jersey for Muslim terrorist activities without monitoring the Muslim community itself."

Their motive, he wrote, "was not solely to discriminate against Muslims, but rather to find Muslim terrorists hiding among ordinary, law-abiding Muslims."

Of The AP, Martini wrote: "The Associated Press covertly obtained the materials and published them without authorization . . . None of the plaintiffs' injuries arose until after the Associated Press released un-redacted confidential NYPD documents and articles expressing its own interpretation of those documents." To put a fine point on his logic, it was The AP's reporting on the spying -- not the spying -- that caused harm to Muslims.

Martini, however, did not say none of the spying efforts were prompted by a specific allegation of a crime. Nor did he say the NYPD operated with no accountability to anyone. Perhaps most important, he did not say the spying produced a single arrest.

So who is this great legal mind and what were his bona fides before his appointment as a federal judge by President George W. Bush -- hardly an avatar of sound judicial appointments?

Martini is a Jersey pol. He served a year as a Hudson County prosecutor before becoming an assistant U.S attorney, and later going into private practice. In 1990, he was elected to the Clifton, N.J., City Council. Two years later, he joined the Passaic County Board of Chosen Freeholders. He was elected as a Republican to the 8th Congressional District, serving a term before being defeated for re-election. His last job before the Bush appointment in 2002 was as a Port Authority commisisoner.

While on the bench, Martini hit a daily double on June 15, 2012, when federal court of appeals panels removed him from two cases on the same day.

The court concluded that in the trial of an attorney accused of orchestrating the murder of a government informant, Martini's rulings and conduct raised questions of bias toward the defendant. Martini, the panel wrote, "usurped the jury's role" by excluding some testimony from the trial in a ruling that "cannot be reconciled with a sound exercise of discretion."

In the second case, which involved heroin and gun charges, the court found he had undermined the prosecutor's professionalism and questioned the government's integrity. When "a judge openly questions the integrity of the government's evidence collection practices, undermines the professionalism of the prosecutor, and accuses the government of prosecuting in bad faith . . . a reasonable observer could very well find neutrality wanting in the proceedings," the court wrote.

Baher Azmy, the legal director at the Center for Constitutional Rights, which was co-counsel representing the Muslim plaintiffs, said he would appeal Martini's decision.

Let's see what the Journal, the Post and the News say if Martini's decision is overturned.