
63 Cal.Rptr.3d 215 (2007)
153 Cal.App.4th 708
In re CHRISTIAN G., a Person Coming Under the Juvenile Court Law.
The People, Plaintiff and Respondent,
v.
Christian G., Defendant and Appellant.
No. B193666.
Court of Appeal of California, Second District, Division Six.
July 24, 2007.
*216 California Appellate Project, under appointment by the Court of Appeal, Jonathan B. Steiner, Executive Director and Richard B. Lennon, Staff Attorney for Appellant.
Edmund G. Brown, Attorney General, Dane R. Gillette, Chief Assistant Attorney General, Pamela C Hamanaka, Senior Assistant Attorney General, Scott A. Taryle, Supervising Deputy Attorney General, Tannaz Kouhpainezhad, Deputy Attorney General, for Plaintiff and Respondent.
YEGAN, J.
Christian G. appeals from a judgment declaring him a ward of the juvenile court and committing him to the Department of Corrections and Rehabilitation, Division of Juvenile Justice, formerly known as the California Youth Authority (CYA). Appellant contends that the juvenile court erroneously determined that his theoretical maximum term of physical confinement was 23 years, 8 months. Relying on Cunningham v. California (2007) 549 U.S. ___, 127 S.Ct. 856, 166 L.Ed.2d 856 (hereafter Cunningham), appellant contends that the juvenile court erroneously computed the theoretical maximum term by utilizing the upper terms for both the felony offense and an enhancement.[1] Following this rather imaginative Cunningham theory, he claims entitlement to middle terms which would compute to a 16-year, 8-month theoretical term of physical confinement. As we shall explain, the theory must be rejected.

Factual and Procedural Background
Appellant admitted a charge of attempted second degree robbery (Pen.Code, §§ 664, 211) as alleged in a petition filed pursuant to section 602 of the Welfare and Institutions Code.[2] Appellant also admitted that he had personally used a firearm (Pen.Code, § 12022.5, subd. (a)) and that the attempted robbery had been committed for the benefit of a criminal street gang. (Pen.Code, § 186.22, subd. (b)(1).) In determining appellant's theoretical maximum term of physical confinement, the juvenile court found that the only mitigating factor was appellant's acknowledgement of his wrongdoing at an early stage of the proceedings. The court found many factors in aggravation. Based on the aggravating factors, the court selected the upper terms of three years for the attempted robbery and 10 years for the firearm use allegation. It also imposed a 10-year enhancement for the gang allegation and consecutive four-month terms for each *217 of two misdemeanor offenses. Thus, appellant's total theoretical maximum term of physical confinement was set at 23 years, 8 months.

Discussion
In Cunningham the United States Supreme Court held that California's determinate sentencing law "violates a defendant's right to trial by jury safeguarded by the Sixth and Fourteenth Amendments" insofar as it permits a court to impose an upper term sentence based on facts found by the court and established only by a preponderance of the evidence. (Cunningham, supra, 127 S.Ct. at p. 860.) Except for a prior conviction, aggravating factors must be either admitted by the defendant or found by a jury and proved beyond a reasonable doubt. (Ibid.) Cunningham overruled a contrary holding in People v. Black (2005) 35 Cal.4th 1238, 29 Cal.Rptr.3d 740, 113 P.3d 534. In Black the California Supreme Court held that, when a trial court exercises discretion to select the upper term sentence based on facts found by the court, the defendant's right to a jury trial is not violated.
Thus, appellant argues, if he had been sentenced as an adult offender, the trial court could not have imposed upper terms for the attempted robbery and firearm use allegation because the aggravating factors had neither been admitted by him nor found true by a jury. Appellant maintains that, pursuant to sections 731, subdivision (b), "the maximum term for a juvenile court commitment is controlled by what the maximum term would be on the same offense in adult court." Since "the maximum available to an adult convicted of appellant's offense would be limited under Cunningham to the middle term, the juvenile court erred in exceeding this maximum. Therefore, the maximum period of confinement must be reduced based upon the use of the middle terms for both the attempted robbery and the gun use allegation attached to it."
Appellant weaves in and out of the juvenile and adult laws with considerable ease. He is not permitted to do so. There is no right to jury trial in juvenile proceedings. (In re Javier A (1984) 159 Cal.App.3d 913, 949, 206 Cal.Rptr. 386 et sec, collecting and analyzing the California Supreme Court cases which so held.) He cannot, at the same time, claim both the rights attendant to adult sentencing proceedings (Cunningham) while reaping the fruits attendant to juvenile proceedings (the opportunity to be released on parole years before an adult would be released).
Section 731, subdivision (b), provides: "A minor committed to the Department of the Youth Authority may not be held in physical confinement for a period of time in excess of the maximum period of imprisonment which could be imposed upon an adult convicted of the offense or offenses which brought or continued the minor under the jurisdiction of the juvenile court. A minor committed to the Department of the Youth Authority also may not be held in physical confinement for a period of time in excess of the maximum term of physical confinement set by the court based upon the facts and circumstances of the matter or matters which brought or continued the minor under the jurisdiction of the juvenile court, which may not exceed the maximum period of adult confinement as determined pursuant to this section. This section does not limit the power of the Youth Authority Board to retain the minor on parole status for the period permitted by Section 17169."
As used in the first sentence of section 731, subdivision (b), "`maximum term of imprisonment' ... `means the longest of the three time periods set forth in paragraph (2) [now paragraph (3) ] of *218 subdivision (a) of Section 1170 of the Penal Code, but without the need to follow the provisions of subdivision (b) of Section 1170 of the Penal Code [middle term imposed absent mitigating or aggravating circumstances] ..., plus enhancements which must be proven if pled.' (§ 726, subd. (c).)" (In re Jacob J. (2005) 130 Cal.App.4th 429, 435, 30 Cal.Rptr.3d 255.) Thus, a minor's theoretical maximum term of physical confinement for an offense may not exceed an adult's maximum term of imprisonment for the same offense based on imposition of the upper term.
The second sentence of section 731, subdivision (b), was added in 2003 by Senate Bill No. 459. (Stats.2003, ch. 4, § 1.) It was intended "to give the juvenile court discretion to impose less than the adult maximum term of imprisonment when committing a minor to CYA and to require the court to set that term of confinement based on the facts and circumstances of each case. [Citation.]" (In re Jacob J, supra, 130 Cal.App.4th at p. 437, 30 Cal. Rptr.3d 255.) "[W]here, as here, the juvenile court sets the maximum term of physical confinement at CYA at the maximum term of adult confinement, the record must show the court did so after considering the particular facts and circumstances of the matter before it." (Id., at p. 438, 30 Cal. Rptr.3d 255.)
In exercising its discretion whether to set the minor's theoretical maximum term of physical confinement at less than the maximum term of imprisonment, the juvenile court is not required to follow the procedures applicable to adult sentencing. The second sentence of section 731, subdivision (b), "has not inserted the adult determinate sentencing scheme into the juvenile indeterminate disposition scheme.... Senate Bill No. 459 created the Youth Authority Board [now the Board of Parole Hearings], which decides the actual length of a minor's confinement at CYA. [Citation.] While [the second sentence of] section 731, subdivision (b), does allow the court to set an earlier outside limit to the indeterminate period of confinement, based on the facts and circumstances of the case, the basic system for determining a minor's actual length of stay, based on the administrative board's decision, remains unchanged." (In re Sean W. (2005) 127 Cal.App.4th 1177, 1188, 26 Cal.Rptr.3d 248.)
"There is nothing in the legislation or its history to suggest the Legislature sought to make sweeping changes in the commitment of a minor to CYA from an indeterminate term to a determinate term, nor is there any provision that the Legislature is restricting the juvenile court to the adult sentencing triad. Proof the juvenile court's decision is not tied directly to the adult system is found in the language utilized; the juvenile court is to consider the facts and circumstances of the matter, rather than being restricted solely to the aggravating or mitigating circumstance scheme for adults. The juvenile court's determination must be tied to the purposes of the juvenile system, which include the protection of the public as well as the rehabilitation of the minor." (In re Carlos E. (2005) 127 Cal.App.4th 1529, 1542, 26 Cal.Rptr.3d 551.)
Thus, in setting a minor's theoretical maximum term of physical confinement based on the facts and circumstances of the case, section 731, subdivision (b), does not compel a juvenile court to adhere to the Cunningham restrictions or the aggravating/mitigating circumstances scheme applicable to the sentencing of adult felons. A contrary interpretation of the statute would ignore the distinction between the determinate sentencing law, which provides for fixed terms designed to punish, *219 and the juvenile justice system, which provides for indeterminate terms designed to rehabilitate. "Any parallel between the adult felon and the juvenile delinquent who have violated the same penal statute ends at the point of beginning of two separate, distinct punishment/rehabilitation statutory schemes. The commitment of the youth, processed through the juvenile court, to the Youth Authority for the maximum period under Welfare and Institutions Code section 731 is in no way the equivalent of the commitment of the adult to prison for the same crime for the upper term based upon aggravation factors. [If] When the juvenile is committed for the maximum period, he is in fact being committed for an indeterminate period. The adult sent to prison for the upper `term prescribed' will be confined for that specific period less any behavior-performance credits. [Citations.] At the heart of the Determinate Sentence Law is the concept of a fixed term. [¶] In contrast, to the juvenile, the `maximum' term is simply the outside time limit for a statutory program aimed directly at rehabilitation." (In re Robert D. (1979) 95 Cal.App.3d 767, 774-775, 157 Cal.Rptr. 339.)
Accordingly, the trial court did not err in determining appellant's theoretical maximum term of physical confinement based on the upper terms for attempted robbery and the firearm use allegation.

Disposition
The judgment (order of commitment) is affirmed.
GILBERT, P.J., and PERREN, J., concur.
NOTES
[1]  In this opinion we use the phrase, "theoretical maximum term of physical confinement" because the "actual term" is indeterminate and is governed by certain guidelines. (In re Jovan B. (1993) 6 Cal.4th 801, 811, 816-818, 25 Cal.Rptr.2d 428, 863 P.2d 673.) In theory, there is no statutory minimum time of physical confinement before a juvenile offender can be released.
[2]  All statutory references are to the Welfare and Institutions Code unless otherwise stated.
