SAN FRANCISCO — A federal judge has cried foul over punches thrown by Takeda Pharmaceutical Co. in a patent brawl to decide the fate of a planned generic for its acid reflux drug.

In an order issued Friday afternoon, U.S. District Judge Lucy Koh of the Northern District of California rejected Takeda’s claims for declaratory judgment that Mylan Inc. will infringe its patents when it begins making a generic for Takeda’s Dexilant drug. Koh wrote that Takeda’s bid for declaratory judgment was overkill in light of other claims it had filed against Mylan under the Hatch-Waxman Act, which governs patent spats over generic drugs.