A shopper was arrested after he threw a chocolate bar at a staff member when he got into a row with him at the checkout.
Paul Behan (44) became threatening and threw the bar after "having words" with the assistant in the incident at a city centre convenience store.
A court heard he had anger management issues.
Judge Ann Ryan adjourned his case for the production of a probation report after he admitted a public order charge.
Behan, of no fixed address, pleaded guilty to using threatening, abusive and insulting behaviour with intent to provoke a breach of the peace.
Dublin District Court heard the accused entered Spar on Nassau Street on November 23 last year.
He "had words with" one of the shop assistants and the argument became heated.
The accused had been trying to buy a bar of chocolate and in the course of the argument he threw it at the staff member, a garda told the court.
He was arrested and charged.
The court heard the defendant had since gone back to the shop and apologised for his behaviour.
A report on the accused was presented to the court and this said that Behan should take part in an anger awareness programme, the judge said.
Behan had been living in England before returning to Ireland in 2016, his solicitor Matthew De Courcy said.
He had found the services limited and there were "nuanced anger management issues" that he was trying to address.
The accused was suffering from anxiety and had been told he could attend group therapy but found that "exceptionally stressful" and felt one-on-one therapy would be better, Mr De Courcy said.
After asking for a probation officer to be consulted, the judge adjourned the case to a date next month.
She remanded Behan on continuing bail.
He did not address the court during the brief hearing.