The AP correctly captures the jist of Judge William Martini’s rejection of a lawsuit against the NYPD for spying on Muslims.

The core of his logic is that Adam Goldman and Matt Apuzzo have injured NYC’s Muslim community by providing them proof of the spying targeted at them.

The ruling also singled out The Associated Press, which sparked the suit with a series of stories based on confidential NYPD document showing how the department sought to infiltrate dozens of mosques and Muslim student groups and investigated hundreds in New York and elsewhere. “Nowhere in the complaint do the plaintiffs allege that they suffered harm prior to the unauthorized release of documents by The Associated Press,” Martini wrote. “This confirms that plaintiffs’ alleged injuries flow from the Associated Press’s unauthorized disclosure of the documents. … The Associated Press covertly obtained the materials and published them without authorization. Thus the injury, if any existed, is not fairly traceable to the city.”

But it doesn’t expose the other part of his shoddy logic clearly enough. Martini said all this spying was cool because it was designed to find Muslim terrorists hiding among Muslims.

The police could not have monitored New Jersey for Muslim terrorist activities without monitoring the Muslim community itself. While this surveillance Program may have had adverse effects upon the Muslim community after the Associated Press published its articles; the motive for the Program was not solely to discriminate against Muslims, but rather to find Muslim terrorists hiding among ordinary, law – abiding Muslims.

As I emphasized here, when it was first reported, NYPD wasn’t hunting for Muslim terrorists in places where the 9/11 terrorists were known to hang out — cheap hotels, gyms, cybercafes, and a bunch of other businesses catering to anonymity rather than Muslims. Rather, the NYPD was hunting terrorists in schools in Newark, including the one above teaching girls in fifth to twelfth grade, and another teaching first through fourth graders.

The NYPD was hunting terrorists in a girls school.

And Judge William Martini thinks that makes a whole bunch of sense.