A teenage boy who ate a stolen strawberry Cornetto ice-cream has been given a conditional discharge for handling stolen goods.
The 16-year-old was caught by fingerprint analysis costing £650, according to his solicitor, and pleaded guilty at Gloucester Youth Court.
"I find it slightly perverse that such a huge amount was spent prosecuting," said Matthew Harbinson.
The Crown Prosecution Service (CPS) said it was in the public interest.
"In this case, we have applied the Code for Crown Prosecutors," a spokesman said.
"This says that, where there is sufficient evidence to charge, and that this is in the public interest, the CPS will prosecute. This case satisfies both of the conditions of the Code."
Mr Harbinson said that there was no suggestion the boy had stolen the ice cream.
On the same day at the same youth court, the solicitor also defended a 15-year old boy against a charge of criminal damage for writing his name with a Twix bar on the wall of a community centre.
The youth was arrested by six police officers and subsequently cleared the writing off the wall of Tewkesbury Community Centre and wrote a letter of apology.
Mr Harbinson said: "It cost a fair amount to arrest him, process him, interview him, for the CPS to bring charges and for him to get a solicitor.
"He came across as a fairly decent man. His mum was amazed. The whole thing was bizarre."
The case was dropped on Thursday.
A CPS spokesman said their lawyer had mistakenly believed a pen had been used to write the graffiti.
"As a word had been written on a wall, and the possible need for professional cleaning appeared in the statement, the prosecutor thought that a pen would be the more likely implement," he said.
"At court the defence informed him that the offending article had been a chocolate bar and that the defendant had later cleaned the wall.
"The lawyer decided then to withdraw the charge and the case was dropped."