MARTINEZ -- Some public employees in four California counties who were promised extra pension benefits when they retire will be able to keep them under a tentative ruling issued Tuesday by Contra Costa County Superior Court Judge David Flinn.

The decision comes more than a year after public employee unions in Alameda, Contra Costa, Marin and Merced counties legally challenged the state's 2012 pension anti-spiking law, which banned counting unused vacation toward pensions.

Flinn found that workers were routinely advised -- even encouraged -- to use the perk, and stripping it away would be unfair.

But the judge limited the exemption to employees who accumulated unused vacation before the law went into effect -- Jan. 1, 2013 -- in excess of what they could earn and cash out in the period used to calculate their pensions.

This is typically the highest earning year, or an average of the highest three years.

Flinn is also phasing out the exception, which means the further away a worker is from retirement, the less likely he or she will collect the extra money.

The judge's decision is tentative, full of unanswered questions and subject to change. Flinn will hear arguments in a hearing set for 2 p. m. Friday in the Martinez courthouse.

Contact Lisa Vorderbrueggen at 925-945-4773, lvorderbrueggen@bayareanewsgroup.com or Twitter.com/lvorderbrueggen.

if you go
What: Contra Costa Superior Court Judge David Flinn will hear arguments about his tentative ruling on litigation challenging California's 2012 anti-spiking pension legislation.
When: 2 p.m., Friday
Where: Contra Costa Superior Court, Dept. 6, 725 Court St., Martinez