Mouhoub Bennafa (44) with addresses at The Gardens, Carrickmines Manor, Dublin 18, and Camden Street, Dublin 2, was seen by a woman in Springfield Lane, Carrickmines, on August 9, 2010.
She told Dun Laoghaire District Court she saw him perform the same act at the same location the following day.
The next day a different witness saw him threaten a man with a rock, telling him he was going to "rape him in the bushes".
The defendant was found guilty of two counts of public indecency, of threatening and abusive behaviour and possession of a large rock.
Judge John O'Connor adjourned the matter to a date in January to allow Bennafa to work with the probation service.