[2] Conviction of a crime is prerequisite to commitment as a mentally disordered sex offender. ( In re Stoneham, 232 Cal.App.2d 337, 340-341 [ 42 Cal.Rptr. 741] .)
One California court has said, it is true, that "conviction of a criminal offense is a sine qua non for procedure." [In re Stoneham, 232 Cal.App.2d 337, 341, 42 Cal.Rptr. 741, 744 (1965).] But California's Supreme Court has construed ยง 5501(a) to mean that the criminal conviction which is the sine qua non need not be one that is final. [Thurmond v. Superior Court, supra, 49 Cal.2d 17, 314 P.2d 6.]
"Conviction of a crime is prerequisite to commitment as a mentally disordered sex offender. ( In re Stoneham, 232 Cal.App.2d 337, 340-341 [ 42 Cal.Rptr. 741].) But proceedings for commitment are civil in nature and are collateral to the criminal proceedings.
Habeas corpus is a proper procedural vehicle for this purpose. ( In re Bevill, 68 Cal.2d 854, 858 [ 69 Cal.Rptr. 599, 442 P.2d 679]; In re Stoneham, 232 Cal.App.2d 337 [ 42 Cal.Rptr. 741].) In this part of section 5512, Welfare and Institutions Code (fourth unnumbered paragraph), in reference to the commitment, the word "indefinite" is used.
( Wilson v. Blabon (9th Cir. 1967) 370 F.2d 997, vacated 393 U.S. 20 [21 L.Ed.2d 19, 89 S.Ct. 49], discussed and considered by the court in In re Bevill, 68 Cal.2d 854, 859 [ 69 Cal.Rptr. 599, 442 P.2d 679].) However, In re Stoneham (1965) 232 Cal.App.2d 337, 340-341 [ 42 Cal.Rptr. 741] was available for guidance. The precise function of affidavits attached to a return or response to an order to show cause in a habeas corpus proceeding does not appear to have been spelled out by California cases.