The system of electing Supreme Court justices in New York violates the rights of voters and judicial candidates and must be scrapped, a federal judge said Friday in a scathing ruling that could change forever the way judicial offices in the state are filled.

Eastern District of New York Judge John Gleeson enjoined the New York State Board of Elections from using the unique — and likely unconstitutional — system of conventions and delegates that now determines which candidates for Supreme Court judgeships appear on election ballots.