A federal judge in New York has deemed a state ban on gravity knives to be unconstitutional — but stopped short of striking down the controversial statute entirely.

Citing the "high risk of arbitrary and discriminatory enforcement," Judge Paul Crotty ruled on Thursday that police officers and prosecutors had too much discretion in enforcing the 1950s-era law. Specifically, the judge mentioned the unreliability of the so-called "wrist-flick test" — an imprecise standard used in the past by both the NYPD and Manhattan District Attorney Cy Vance to see whether the folding knives require force to open.

"Criminal culpability here is tied to a vague definition and functional test that could have outcomes depending on who is performing it and when," wrote Crotty. "People should be able to tell whether their conduct is lawful or unlawful."

Criminal justice advocates have long argued that the ban unfairly targets chefs and other service employees who use folding knives for work. In one high-profile case, police arrested chef Nate Appleman, who was at the time in charge of the kitchen at Keith McNally's now-defunct Bowery pizza restaurant Pulino's.

Analyses from both the Legal Aid Society and the Village Voice found that the vast majority of people charged with gravity knife possession in New York are black and Hispanic.

The state legislature has passed legislation to decriminalize certain gravity knives in recent years, but Governor Andrew Cuomo has twice vetoed the measure.

As advocates celebrated the judge's decision, they were also quick to note that the opinion does not necessarily invalidate the law. For now, the decision only applies to the plaintiff in the case: Joseph Cracco, a sous chef who was arrested in Grand Central Terminal in 2013 for carrying a folding knife that he used for work. Though the law will likely be used to argue against gravity knife charges in future cases, it is merely a "step toward [the] ultimate goal" of repeal, according to public defenders.

With that aim in mind, the Appeal reports that State Assemblymember Dan Quart introduced a bill last month to strike the term gravity knife from the penal code altogether. The Manhattan assemblyman expects the bill to move easily through the Democratic-controlled legislature, ending up on Cuomo's desk by the end of the year.

The Governor's Office did not respond to Gothamist's inquiries about whether he would sign the legislation, or his reaction to the federal judge's ruling. A spokesperson for the Manhattan D.A. Cy Vance — one of the law's most vocal defenders — said in a statement that the office was "reviewing the decision."