After a Superior Court judge just wiped out one abusive public employee pension-spiking practice in Contra Costa, a bitterly divided retirement board has decided to end another.

It's the right move but could set off a second protracted legal fight. The pension board chairman, who opposes the change and will be personally affected by it, has publicly encouraged employees to sue and promised to testify on their behalf.

At issue in both disputes is how to treat compensation for unused leave time when calculating pensions. Retirement payments are a function, in part, of a worker's years on the job and highest salary, usually the average from the last 12 months on the job.

Unlike most county-level pension systems, Contra Costa and Alameda counties had been allowing workers to include not only salary but also one-time payments they received at termination for unused leave time such as vacation.

That practice of including "terminal pay" in pension calculations was prohibited by past legal rulings and again under a law Gov. Jerry Brown signed in 2012. Earlier this year, Contra Costa Superior Court Judge David Flinn rejected a union lawsuit trying to stop implementation of that law.

A state appellate court panel that will eventually rule on the case, probably next year, refused to block Flinn's ruling in the meantime. As a result, the last day for affected workers to retire and count terminal pay in pension calculations was Friday.

Meanwhile, many employees in the two counties can also annually sell back some of their unused vacation. During the litigation over the 2012 law, Flinn and attorneys for both sides generally agreed a worker could legally count in a pension calculation the annual payment for unused vacation because it was a recurring event.

Here's where it gets tricky: Employees who can sell back vacation are usually allowed to do so once every calendar year. But the income counted in pension calculation is for any consecutive 12-month period.

Thus, a worker knowing he planned to retire at the end of March could sell back vacation in December of the prior year and again in January -- and count both payments as income when calculating his pension. It's a practice called "straddling."

Although he had been urged to rule on the legality of straddling, Judge Flinn never addressed the issue, leaving uncertainty whether the practice could continue under the new law.

Contra Costa retirement board trustees say their attorney has told them they have the legal discretion to either allow or prohibit the practice. On Wednesday, at the second acrimonious meeting on the issue, they voted 5-4 to end it.

The four trustees appointed by the county Board of Supervisors and the county treasurer supported the move. The four worker and retiree representatives opposed it. Trustees of the Alameda County retirement system will soon consider the same issue.

How much is at stake for Contra Costa County workers? Flinn's decision on terminal pay wiped out a spike that boosted pensions as much as 15 percent.

For those who can also sell back vacation, primarily managers and attorneys who comprise less than 20 percent of the county workforce, the retirement board decision on straddling eliminated another spike of as much as 4.5 percent.

Brian Hast is among those affected. A deputy district attorney who has worked for the county 30 years, he's also chairman of the pension board.

Usually soft-spoken at meetings, Hast unloaded at the two meetings, inviting employees to sue the retirement board and accusing the board majority of breaching its fiduciary duty to protect workers' pensions. When the law is unclear, he said, trustees must err on the side of the employees.

But Trustee Karen Mitchoff, a county supervisor, noted that the pension board's attorney said the action was permissible under Judge Flinn's ruling and the new law. Moreover, she said, trustees have a duty to all employees, not just to those who can sell back vacation.

Finally, Trustee Debora Allen cut to the chase. However one might interpret the law, this sort of spiking "is not what the whole system was designed for."

On that, she's absolutely right.

Daniel Borenstein is a staff columnist and editorial writer. Reach him at 925-943-8248 or dborenstein@bayareanewsgroup.com. Follow him at Twitter.com/BorensteinDan.