
161 Cal.App.3d 646 (1984)
207 Cal. Rptr. 751
In re HENRY C., a Person Coming Under the Juvenile Court Law.
THE PEOPLE, Plaintiff and Respondent,
v.
HENRY C., Defendant and Appellant.
Docket No. F003163.
Court of Appeals of California, Fifth District.
November 2, 1984.
*647 COUNSEL
Richard L. Phillips, under appointment by the Court of Appeal, for Defendant and Appellant.
*648 John K. Van de Kamp, Attorney General, W. Scott Thorpe and David De Alba, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[1]]
OPINION
MARTIN, J.
The Kings County District Attorney filed two supplemental petitions alleging Henry C. was a minor within the meaning of Welfare and Institutions Code section 602. Each petition charged that the minor dissuaded witnesses within the meaning of Penal Code section 136.1, subdivision (c)(1). The second petition further alleged the minor was on probation at the time of that offense and had violated his probation.
On July 29, 1983, a contested jurisdictional hearing commenced before Judge Dennis L. Beck. On August 1, after three prosecution witnesses had testified, Judge Beck declared he could not be fair and impartial because of "some preconceived notions as to the credibility" of some of the witnesses. He declared a mistrial and disqualified himself.
On August 12, the minor's second jurisdictional hearing commenced before visiting Judge William L. Silveira, Jr. Judge Silveira sustained both petitions and the minor was committed to the California Youth Authority (CYA). The minor appeals.

I.

STATEMENT OF FACTS[*]
.... .... .... .... .... .... .

II.

DISCUSSION

DOUBLE JEOPARDY
The minor contends the lower court violated the constitutional prohibition against double jeopardy after declaring a mistrial at the first jurisdictional hearing. (1) However, failure to interpose a plea of double jeopardy in the trial court waives the defense and it cannot be raised for the first time *649 on appeal. (People v. Franklin (1976) 56 Cal. App.3d 18, 23 [128 Cal. Rptr. 94]; People v. Fairchild (1967) 254 Cal. App.2d 831, 835 [62 Cal. Rptr. 535]; cert. den. (1968) 391 U.S. 955 [20 L.Ed.2d 870, 88 S.Ct. 1861].) In the instant case, the minor failed to plead double jeopardy at the second jurisdictional hearing. Nevertheless, he contends the issue may be raised on appeal pursuant to this court's decision in People v. Medina (1980) 107 Cal. App.3d 364 [165 Cal. Rptr. 622]. In Medina, defendant was charged with taking and driving a vehicle without the owner's consent. The jury deliberated 50 minutes, advised the judge it was deadlocked, and requested further instructions. The court refused to answer questions or give additional instructions and declared a mistrial. On retrial defendant failed to raise the defense of double jeopardy and was convicted. Since the plea had merit, trial counsel's failure to raise it withdrew a crucial defense from the case and deprived defendant of the adequate assistance of counsel. The minor was thus deprived of adequate counsel as a matter of law and the Fifth District reversed the conviction. As we will explain, Medina is distinguishable from the instant case and will not relieve defendant from his waiver below.
The minor's jurisdictional hearing began on July 29, 1983, before Judge Dennis L. Beck. After hearing the testimony of prosecution witnesses Victor Velasquez, Joe Navarro, and Oai Kay Allen, Judge Beck asked counsel to join him in chambers. The judge then stated on the record:
"[THE COURT] ... I asked to speak to counsel in chambers on this matter because something has developed, actually, in the course of receiving evidence in this case, and not knowing what the evidence, of course, was, or who the witnesses were to be in this matter, I had no notice of what it was about, they were about to state previously  really, previous to the hearing, and the testimony and the cross-examination of Allen and the following, I feel that I cannot be fair and impartial in this case, and in deciding this petition as to minor Henry [C.] for the following reasons:
"The case appears to turn substantially on the testimony of the witness Oi [sic] Kay Allen, Donna Cruz, who will be called either for the People or the defense witnesses  I'm not sure 
"MR. WOODBURY [deputy district attorney]: Both sides.
"THE COURT: Both sides  and Mike Sanchez, and all of those minors who have been subpoenaed to appear at the Velasquez hearing before this Court and who, as in the case of Donna Cruz and Oi [sic] Kay Allen, have been committed to the Youth Authority by this Court as well as to various other commitments in an attempt to  based on their prior cases and the *650 Court's conduct and disposition of their cases, I feel that I have some preconceived notions as to the credibility of both those witnesses and as to Mike Sanchez, I have received or recently had a contested jurisdictional hearing, and pending disposition, I think, before this Court on another case, charged with being under the influence of PCP, and I also have preconceived notions as to Michael Sanchez' credibility...."
Judge Beck concluded, "I don't feel that I can be fair to either side in this matter." The matter was continued to August 1, 1983. Although neither party asked the court to declare a mistrial, Judge Beck made the following ruling:
"THE COURT: All right. This matter was continued from last Friday when the Court began hearing the jurisdictional hearing in this matter, and then upon learning who the primary witnesses, both for the defense and the People, were in this matter, stated that it is my feeling that I cannot be fair and impartial in this matter.
"The matter was continued until this morning for argument on what the proper disposition was, whether or not the Court's statement constituted a legal necessity  since that time, Mr. Woodbury has referred me to the case of P.B. [sic] versus Superior Court of 66 Cal. App. 3rd, 881, a 1977 case, which appears to be directly on point in this matter.
"I would find, therefore, that there is a legal necessity for a declaration of mistrial in this matter, and I would declare a mistrial.
"The matter remains set for a further jurisdictional hearing or a new date for a jurisdictional hearing in this matter, and the Court will set the matter for hearing on Friday, the 12th of August, at 2:00 p.m."
(2) Article I, section 15 of the California Constitution provides in relevant part: "Persons may not twice be put in jeopardy for the same offense, be compelled in a criminal cause to be a witness against themselves, or be deprived of life, liberty, or property without due process of law." (See also U.S. Const., Fifth Amend.)
Double jeopardy prohibits a second prosecution of the same individual for the same offense. (In re Aaron N. (1977) 70 Cal. App.3d 931, 940 [139 Cal. Rptr. 258].) The idea underlying the prohibition is that the state with all its resources and power should not be allowed to make repeated attempts to convict an individual for an alleged offense.
In proceedings before the juvenile court, juveniles are entitled to constitutional protections against twice being placed in jeopardy for the same *651 offense. (Breed v. Jones (1974) 421 U.S. 519, 529-531 [44 L.Ed.2d 346, 355-356, 95 S.Ct. 1779]; Richard M. v. Superior Court (1971) 4 Cal.3d 370, 375-377 [93 Cal. Rptr. 752, 482 P.2d 664].)
In a court trial, jeopardy does not attach until the first witness has been sworn. A juvenile proceeding is analogous to a court trial for purposes of jeopardy attachment because juveniles have no inherent right to a trial by jury. (Richard M. v. Superior Court, supra, 4 Cal.3d 370, 376; In re Hector R. (1984) 152 Cal. App.3d 1146, 1154 [200 Cal. Rptr. 110].) Accordingly, jeopardy attached in the instant case when the first witness was sworn at the jurisdictional hearing. A juvenile cannot be retried and placed in jeopardy following mistrial unless the mistrial was consented to or there was legal necessity for the declaration of a mistrial. (Curry v. Superior Court (1970) 2 Cal.3d 707, 712-713 [87 Cal. Rptr. 361, 470 P.2d 345]; Paulson v. Superior Court (1962) 58 Cal.2d 1, 5 [22 Cal. Rptr. 649, 372 P.2d 641]; T.P.B. v. Superior Court (1977) 66 Cal. App.3d 881, 884 [136 Cal. Rptr. 311].)
(3a) The minor did not consent to a mistrial in the instant case. Therefore, the issue is whether the court's decision to grant a mistrial on its own motion was a legal necessity. The minor relies on Scott v. Municipal Court (1971) 17 Cal. App.3d 885 [95 Cal. Rptr. 460], in asserting a violation of double jeopardy. In Scott, petitioner was charged with soliciting an act of prostitution. (Pen. Code, § 647, subd. (b).) At trial the court admitted testimony of conversations, outside defendant's presence, with another woman charged with a similar offense on the same occasion. After the case was submitted, the trial court referred to these conversations in summarizing the evidence. Defense counsel objected to consideration of that evidence on the issue of guilt and advised the court the other woman had been acquitted of the charges. The court chastised counsel for making the statement, declared he could no longer render an impartial verdict, and declared a mistrial. On retrial, defendant's plea of double jeopardy was rejected by the trial court. The Second District Court of Appeal ordered issuance of a peremptory writ prohibiting respondent court from taking any further action in the case except to dismiss it. The court concluded no "legal necessity" existed within the meaning of Curry v. Superior Court, supra.
Plaintiff relies on T.P.B. v. Superior Court, supra, 66 Cal. App.3d 881, in asserting no double jeopardy violation occurred in the instant case. In T.P.B., the Alameda County District Attorney filed a verified petition alleging the minor was a person described in Welfare and Institutions Code section 602 and that he committed burglary. (Pen. Code, § 459.) An adjudicatory hearing was held before a judge of the juvenile court. During voir dire of a police officer by the minor's counsel, the judge disqualified himself *652 and declared a mistrial. The judge's disqualification was based on his inability to fairly and impartially consider the evidence. The minor did not move for or consent to the mistrial. Following the mistrial the matter was set for hearing before a different judge and minor sought to plead once in jeopardy. (Pen. Code, § 1016, subd. 5.) The court rejected the plea based on a legal necessity for the mistrial. The First District Court of Appeal distinguished Scott on its facts and denied a petition for writ of prohibition against further proceedings. In Scott the trial court ordered a mistrial after the case had been submitted for decision. In T.P.B. the mistrial was declared prior to submission of the case and after the judge declared his disqualification. The Court of Appeal held any act of a disqualified judge (Code Civ. Proc., § 170)[2] is absolutely void whenever brought into question. A judgment rendered by such a judge is open to attack at any time. In T.P.B. the judge declared his disqualification based on bias or prejudice. Thus, a legal necessity existed for order of mistrial because the trial judge was disqualified as a matter of law from continuing to sit and act in the case. The judge was unable to afford petitioner a fair and impartial trial. Had he proceeded with trial he would have offended the basic concepts of due process.
The minor's contention that T.P.B. should not control in the instant case is without merit. He first argues that, unlike Scott, this trial judge did not disqualify himself under Code of Civil Procedure section 170. The record of the proceedings here is entitled: "disqualification of the court on its own motion under Penal Code section 170." Defendant would exalt form over substance. Penal Code section 170 refers to malicious procurement of a warrant. It is apparent the clerk and court reporter erred; they intended to cite Code of Civil Procedure section 170. The record indicates Judge Beck substantially complied with the requirements of Code of Civil Procedure section 170, subdivision (b).
(4) The minor next contends Code of Civil Procedure section 170, subdivision (a)(5), applies only to bias or prejudice directed against a party or *653 his counsel and not against witnesses. (Woolley v. Superior Court (1937) 19 Cal. App.2d 611, 626 [66 P.2d 680].) Woolley stands for the proposition that bias or prejudice within the meaning of Code of Civil Procedure section 170 must be bias or prejudice directed against a party or his counsel. Previously, in Evans v. Superior Court (1930) 107 Cal. App. 372, 379 [290 P. 662], the Second District Court of Appeal held a judge's alleged prejudice against a witness insufficient to invoke Code of Civil Procedure section 170. The Evans rule was premised on out-of-state authorities. The validity of the Woolley and Evans rule is questionable in our view. The Evans rule is inconsistent with the Second District's definition of "bias and prejudice" in that case. We note the code section has been amended numerous times in the past 45 years. In its present form, the express language of Code of Civil Procedure section 170, subdivision (a)(5), is not limited to a judge's bias or prejudice against a party. A judge's bias or prejudice toward a party's witness would clearly impair his impartiality and sway his judgment as to the party and the case. Thus, we conclude that Code of Civil Procedure section 170, subdivision (a)(5), is not limited in application to a party or his counsel. To the extent this conclusion is in conflict with Woolley and Evans, we reject their reasoning.
Finally, the minor contends Larios v. Superior Court (1979) 24 Cal.3d 324 [155 Cal. Rptr. 374, 594 P.2d 491] controls the instant case. In Larios, petitioner was charged with robbery of a dairy store. Petitioner testified he was not in the dairy store on the date of the robbery. Rather, he and a cousin went to a department store to buy blue jeans advertised on sale. A juror employed by an area newspaper examined back issues of the publication and discovered the department store did not advertise a sale on the robbery date. The juror informed the trial court of his discovery and indicated no one else on the jury was aware of the information. Because there were no alternate jurors available, the trial court asked defense counsel if he would stipulate to an 11-person jury. Counsel declined and the court declared a mistrial pursuant to Penal Code sections 1120 and 1123[3] without seeking petitioner's consent. The California Supreme Court ordered issuance of a peremptory writ of prohibition against further proceedings. The court found no legal necessity within the meaning of Curry to deprive petitioner of his constitutionally protected freedom to proceed with that jury. Once petitioner became aware of the misconduct and the judge's willingness to declare a mistrial, the decision as to the extent of prejudice was for petitioner and his counsel. Curry guaranteed an accused the freedom to proceed with his original jury although all its members had been exposed *654 to prejudicial error. The court held it anomalous to deny petitioner that same freedom of choice where the error involved only one juror.
In our view, Larios and the instant case are legally and factually distinguishable. In Larios, the trier of fact was the jury and a juror obtained information outside the judicial proceedings which caused him to be biased and prejudiced against the defendant. In the instant case the judge was the trier of fact. In Larios, it was the petitioner's decision whether the extent of prejudice on the part of one juror was such that he, petitioner, should or should not consent to the court's declaration of a mistrial. (3b) Here, the trial judge was precluded by the express language of Code of Civil Procedure section 170, subdivision (a)(5), from proceeding with the hearing. In light of his announced bias and prejudice he was required to disqualify himself. By definition, he could no longer be a "judge" in this case. This clearly constituted a legal necessity for an order of mistrial and the second jurisdictional hearing did not violate the constitutional prohibition against double jeopardy.

III.

WAS THE MINOR DENIED THE EFFECTIVE ASSISTANCE OF COUNSEL?[*]
.... .... .... .... .... .... .
The judgment is affirmed.
Hanson (P.D.), Acting P.J., and Ardaiz, J.,[] concurred.
A petition for a rehearing was denied November 28, 1984, and appellant's petition for a hearing by the Supreme Court was denied January 17, 1985.
NOTES
[1]  Parts I and III are not published, as they do not meet the standards for publication contained in rule 976(b), California Rules of Court.
[*]   See footnote 1, ante, page 646.
[2]  Code of Civil Procedure section 170, as amended by Statutes 1982, chapter 1644, section 1, pages 6678-6680 provides in relevant part: "(a) No justice or judge shall sit or act as such in any action or proceeding:

".... .... .... .... .... .... .
"(5) When it is made to appear probable that, by reason of bias or prejudice of such justice or judge a fair and impartial trial cannot be had before that justice or judge.
".... .... .... .... .... .... .
"(b) Whenever a judge or justice shall have knowledge of any fact or facts, which, under the provisions of this section, disqualify him or her to sit or act as such in any action or proceeding pending before him or her, it shall be his or her duty to declare the same in open court and cause a memorandum thereof to be entered in the minutes or docket. It shall thereupon be the duty of the clerk, or the judge if there be no clerk, to transmit forthwith a copy of the memorandum to each party, or his attorney, who shall have appeared in the action or proceeding, except such party or parties as shall be present in person or by attorney when the declaration shall be made."
At the time T.P.B. was decided, the foregoing provisions were substantially the same.
[3]  Penal Code section 1120 permits a court to discharge a juror for good cause if he has personal knowledge respecting a fact in controversy. Penal Code section 1123 permits a court to discharge a juror for good cause if he becomes sick or otherwise unable to perform his duty.
[]   Assigned by the Chairperson of the Judicial Council.
