At the Central Criminal Court 23-year-old Derek Stanley from Dominic Street in Dublin pleaded guilty to burglary and to procuring sex under false pretences in October 2007.
Mr Justice Barry White said his 'hands were tied' by the maximum sentence for the sex offence which is two years and said he had to treat the offences separately.
Earlier he had asked counsel for the prosecution why the DPP had accepted a plea to a charge which carries a maximum sentence of two years.
He imposed a concurrent sentence of two years for the sex offence after rejecting submissions from prosecuting counsel to view it as an aggravating factor in the burglary.
Defence counsel Michael O'Higgins has earlier submitted that it was 'an old offence' for which the penalty had not caught up with modern attitudes. He said perhaps it was time for the Oireachtas to update the legislation.
The court heard the victim was asleep when the accused got into bed behind her. She had been in bed with her boyfriend earlier in the night and thought he had returned.
Moments after they began having sex she realised it was not her partner.
She told gardaí that she pushed him away and got out of bed and got dressed but the accused remained in her room and sat on the end of her bed.
She then went to a neighbour's flat and he followed her but left when the victim's boyfriend arrived. She told gardaí she believed he was 'off his head' on drugs.
One of the woman's children was in the house at the time.
Stanley presented himself to gardaí a few days later after locals began talking about what had happened. He denied any criminal offence had taken place and said he had met the woman earlier and had been invited back to her home.
He later pleaded guilty on the day his trial was due to begin.
CCTV footage showed him leaving the flat with her property and immediately returning. The €140 in cash and jewellery and six mobile phones which he stole from the flat were never returned.
Gardaí told the court that the woman now lives in fear and is on antidepressants. She needs help to carry out the simplest of domestic tasks and is afraid to leave her home.
Derek Stanley has more than 50 previous convictions including one for another offence committed on the same night.
Defence counsel Michael O Higgins said his client wanted to apologise for his actions. He had a difficult upbringing and had a history of drug and alcohol abuse from the age of 12 and first came before the courts at the age of 14.
