You don't get sentenced for nearly doing something. You get sentenced based on fact and evidence. He in this case I believe was handed his sentence based on 2 things
1. His intent to do someone harm, injury or bodily harm via the action of throwing said extinguisher from the top of the building, this is very different from saying he attempted to murder someone. I don't think he was attempting murder. I do however think he was intending to cause someone harm / bodily injury. This I think is a fact and could be extrapolated and diagnosed using the available footage of the day.
2. Judge probably thought it was a good opportunity to make an example of this idiot so that other rioting students will think properly about turning up in London and smashing the place up as now they know if they are slightly over zealous they have a good chance of doing time at her majesties pleasure. This is not really justification, but does fulfil the part of sentencing acting as a formidable deterrent for others.