A stipulation limiting appellant’s SVP recommitment to a two-year term should be upheld under the doctrine of judicial estoppel. When Jessica’s Law was on the ballot, the Los Angeles District Attorney and Public Defender entered into a stipulation that pending SVP recommitments petitions, including appellant’s, would be for two years instead of indeterminate terms as provided by the proposed legislation. After the effective date of Jessica’s Law, a jury returned verdicts finding appellant continued to qualify as an SVP, and the trial court committed him under the terms of the stipulation. After appellant appealed, the Attorney General asked the court to make the two-year commitments indeterminate terms. The State argued that the two-year term violated Jessica’s Law because appellant’s SVP trial had occurred after the effective date. The Court of Appeal converted the commitment to an indeterminate term. Applying the doctrine of judicial estoppel, the Supreme Court reversed. The Court found it significant that in the amended version there was no mention of or provision for recommitment petitions, and so it was possible that appellant would be able to avoid recommitment altogether. In light of the uncertain state of the law when the Los Angeles County District Attorney and Public Defender stipulated that only the two-year commitment term would be sought, and in light of the parties’ evident intent in signing the agreement to avoid the unwarranted dismissal of long-pending SVP petitions, the stipulation should be enforced. Enforcement would promote the goals of the judicial estopped doctrine, namely maintaining the integrity of the judicial system and protecting appellant and others similarly situated from opposing counsels’ unfair strategies.