The New York Court of Appeals ordered the removal of an upstate judge who had joked to attorneys about his ex-wife’s sexual preferences, among other inappropriate sexual comments, and had exposed a firearm in the courthouse.

The 6-0 Court of Appeals order, for which Judge Jenny Rivera didn’t take part, came on the heels of a determination by the New York State Commission on Judicial Conduct in February that Jeremy L. Persons, a justice of Guilford Town Court in Chenango County, should be removed from office.