
71 Cal.2d 352 (1969)
THE PEOPLE, Plaintiff and Respondent,
v.
WENDELL KELLUM, Defendant and Appellant.
Crim. No. 13271. 
Supreme Court of California. In Bank.  
June 18, 1969.
 Lloyd B. Egenes, under appointment by the Supreme Court, for Defendant and Appellant.
 Thomas C. Lynch, Attorney General, Robert R. Granucci and Michael Buzzell, Deputy Attorneys General, for Plaintiff and Respondent.
 TRAYNOR, C. J.
 In 1963 a jury found defendant guilty of one count of assault with intent to commit rape (Pen. Code,  220) and one count of forcible rape (Pen. Code,  261, subd. 4). Before sentencing, the court adjourned the criminal *353 proceedings and instituted sexual psychopathy  [fn. 1] proceedings. (Welf. & Inst. Code,  5500 et seq.)pursuant to such proceedings, defendant was committed to Atascadero State Hospital. In June 1967 the court held a hearing and found "that the defendant is still a mentally disordered sex offender and not amenable to treatment." It thereupon reinstituted the criminal proceedings and in November 1967 sentenced defendant to imprisonment for the term prescribed by law. Defendant appeals.
 Defendant contends that at his trial prejudicial admissions were introduced against him that were obtained in violation of the rules subsequently announced in Escobedo v. Illinois (1964) 378 U.S. 478 [12 L.Ed.2d 977, 84 S.Ct. 1758] and People v. Dorado (1965) 62 Cal.2d 338 [42 Cal.Rptr. 169, 398 P.2d 361]. Since we have held that those rules apply to all cases not final before Escobedo was decided on June 22, 1964 (People v. Rollins (1967) 65 Cal.2d 681, 691 [56 Cal.Rptr. 293, 423 P.2d 221]; In re Lopez (1965) 62 Cal.2d 368, 372 [42 Cal.Rptr. 188, 398 P.2d 380]; In re Shipp (1965) 62 Cal.2d 547, 549 [43 Cal.Rptr. 3, 399 P.2d 571]), defendant concludes that the judgment must be reversed. The Attorney General contends that cases such as this one, which was tried before Escobedo but in which entry of judgment was postponed owing to a commitment under the provisions of the Welfare and Institutions Code, should be treated as exceptions to the rule of the Lopez case. He points out that such an exception is permissible under the holding in Johnson v. New Jersey (1966) 384 U.S. 719 [16 L.Ed.2d 882, 86 S.Ct. 1772], that state courts are not constitutionally compelled to apply Escobedo to cases in which trial commenced before June 22, 1964. He invokes People v. Rivers (1967) 66 Cal.2d 1000 [59 Cal.Rptr. 851, 429 P.2d 171] in which we held that Escobedo and Dorado are not applicable to cases in which the judgments became final before Escobedo was decided under then existing appellate procedures but in which remittiturs were recalled after Escobedo to meet evolving standards of representation of counsel on appeal. *354
 [1] We believe that the controlling decision is not Rivers but Rollins.  [fn. 2] In Rollins, we squarely confronted the question whether in view of Johnson we should continue to apply Escobedo and Dorado to pending appeals in cases tried before Escobedo. We determined that we should. We pointed out that our application of Escobedo to all cases still pending on direct review when Escobedo was decided was consistent with the settled law before Johnson was decided, that to continue to so apply Escobedo would impose no major burden on the administration of justice, and that to cease doing so would give rise to wholly arbitrary inequalities. "The vast majority of cases in California which had not become final prior to June 22, 1964, have by this time been disposed of on appeal in accordance with the teaching of Escobedo and Dorado. Accordingly, we need not invite the anomalies and the manifest injustice which the rejection of Lopez, at the virtual end of its natural life, would entail. Thus ... we adhere to Lopez in applying Escobedo and Dorado to the instant case and to all other cases which had not become final before June 22, 1964." (People v. Rollins, supra, 65 Cal.2d at p. 691.)
 Defendant is a member of the precise class we deemed entitled to protection from arbitrary discrimination in Rollins, namely, those tried before Escobedo whose convictions were still subject to review when Johnson was decided. Defendant is in no way to blame for the delay in the finality of the judgment against him, for that delay was, until the 1968 amendment to Penal Code section 1237, inherent in the statutory provisions governing commitment and appellate procedures. (People v. Gonzales (1968) 68 Cal.2d 467, 471 [67 Cal.Rptr. 551, 439 P.2d 655].) Finally, to deny persons such as defendant the benefit of Escobedo would create additional discriminations within the class to which he belongs. Thus, those tried before Escobedo but against whom no judgment was entered until after Johnson would receive the benefit of Escobedo if they had the foresight to invoke Escobedo on motion for new trial or on appeal from the denial of such a motion during the interval between Escobedo and Johnson, but would be denied the benefit of Escobedo if they elected instead, while rehabilitative treatment continued, not to challenge the validity of their convictions until appealable judgments were entered against them.people v. Gonzales, supra, forbids such discrimination.
 There is nothing in Rivers contrary to our conclusion *355 herein. In that case we were concerned with defendants who had exhausted all avenues of appellate review before Escobedo was decided and whose judgments would have remained final but for the decision in Douglas v. California (1963) 372 U.S. 353 [9 L.Ed.2d 811, 83 S.Ct. 814], requiring representation of counsel on appeal. Those defendants were not part of the class considered in Rollins; namely, those tried before Escobedo whose judgments were never reviewed on appeal until after Johnson. They represented a separate category that threatened to be of significant quantity. Considerations of equality also dictated that they should be treated, not as though their appeals had never been decided, but according to the law applicable when their first appeals were decided. Otherwise, "the indigent defendant deprived of counsel anomalously would find himself possessed of more shafts in his quiver than would have been the case had he been able to afford to properly arm himself in the first instance." (People v. Garner (1965) 234 Cal.App.2d 212, 215-216, fn. 1 [44 Cal.Rptr. 217].) Moreover, allowing such defendants to invoke Escobedo as a byproduct of Douglas would have involved the serious difficulties of retrials long after the events involved had occurred. In the present case, defendant is seeking appellate review of his conviction for the first time. Allowing him to invoke Escobedo affords him no "more shafts in his quiver" than he would have had if he had raised Escobedo by motion for new trial soon after it was decided. The difficulties of a belated retrial arise, not from the reopening of an apparently final judgment, but from the statutory provisions that provided for appeals from judgments that need not have been entered until long after the underlying convictions on which they were based.
 Although defendant is no longer being held pursuant to the temporary and indefinite orders committing him to Atascadero, he is entitled to challenge those orders to clear his record. (People v. Succop (1967) 67 Cal.2d 785, 789-790 [63 Cal.Rptr. 569, 433 P.2d 473].) Since a valid commitment must be based upon a valid conviction (In re Bevill (1968) 68 Cal.2d 854, 862-863 [69 Cal.Rptr. 599, 442 P.2d 679]; Welf. & Inst. Code,  5501), the orders of commitment must be vacated.
 The orders committing defendant to Atascadero State Hospital are vacated. The judgment is reversed.
 McComb, J., Peters, J., Tobriner, J., Mosk, J., Burke, J., and Sullivan, J., concurred.
NOTES
[fn. 1]  1. These proceedings are now called mentally disordered sex offender proceedings. The article defining and describing the disposition of mentally disordered sex offenders, formerly codified as Welfare and Institutions Code sections 5500-5522, has been recodified as Welfare and Institutions Code sections 6300-6330. The section numbers appearing in the text conform to the old classification.
[fn. 2]  2. To the extent that People v. Williams (1968) 265 Cal.App.2d 951 [71 Cal.Rptr. 871], is contrary to our decision herein it is disapproved.
