Rosa Salazar -- who's starring in the upcoming James Cameron/Robert Rodriguez blockbuster "Alita: Battle Angel" -- has one less real-life battle to worry about ... TMZ has learned.
Court sources tell us ... Rosa squared off against her ex-boyfriend, Sam Setzer, and his lawyers Wednesday in front of a judge over claims he made last month that she harassed and threatened him after a breakup.
We're told the judge heard both sides and decided to dismiss the case and toss the restraining order Setzer had gotten against Rosa. The judge said there were no grounds for it.
Rosa's appeared in "American Horror Story" and the 'Maze Runner' films. She's playing the title character in 'Alita' -- with co-stars Jennifer Connelly, Michelle Rodriguez and Christoph Waltz -- which comes out later this year.