This section applies where a court is determining—
of an extended sentence of detention under section 254 to be imposed on an offender in respect of an offence.
The appropriate custodial term is the term of detention that would be imposed in respect of the offence in compliance with section 231(2) (length of discretionary custodial sentences: general provision) if the court did not impose an extended sentence.
The term of the extended sentence of detention under section 254 must not exceed the maximum term of imprisonment with which the offence is punishable in the case of a person aged 21 or over.