I think I first saw the term in this David Eddings novel, where a crime lord is rattling off the crimes he HASN'T done.
‘Is there any crime you haven’t committed, Master Platime?’ she asked sternly.
‘Barratry, I think, Your Majesty. Of course I’m not sure what it means, so I can’t be entirely positive.’
‘It’s when a ship captain wrecks his ship in order to steal the cargo,’ Stragen supplied.
‘No, I’ve never done that. Also, I’ve never had carnal knowledge of an animal, I’ve never practised witchcraft, and I’ve never committed treason.’
‘Those are the more really serious ones, I suppose,’ Ehlana said with a perfectly straight face. ‘I do so worry about the morals of foolish young sheep.’
Platime roared with sudden laughter. ‘I do myself, Your Majesty. I’ve spent whole nights tossing and turning about it.’
(Eddings had his flaws, but I always loved his dialogue.)