
181 Cal.App.3d 510 (1986)
226 Cal. Rptr. 423
In re the Marriage of BETTY A. and ROBERT M. DOUD.
BETTY A. DOUD, Respondent,
v.
ROBERT M. DOUD, Appellant.
Docket No. 24445.
Court of Appeals of California, Third District.
May 23, 1986.
*516 COUNSEL
William Neil Shepherd for Appellant.
Rex T. Kearney, Jr., Ingoglia, Marskey, Kearney & Kuperstein and Steven J. Green for Respondent.
OPINION
BLEASE, J.
Two and one-half years after the entry of a judgment awarding Robert Doud (Robert) a federal military pension as his separate property, Betty Doud (Betty) moved to modify the judgment pursuant to Civil Code section 5124.[1] The judgment had been entered pursuant to a stipulation with Betty to apply the impending ruling in McCarty v. McCarty (1981) 453 U.S. 210 [69 L.Ed.2d 589, 101 S.Ct. 2728]. The trial court granted the motion, awarding Betty an interest in the pension. In this appeal Robert challenges the constitutionality of section 5124 as impairing a contract embodied in the stipulation and rights vested in the judgment. Alternatively he contends the trial court erred in failing to grant his motion to set aside the entire stipulated judgment. We will reject the contentions and affirm the judgment.

PRELIMINARY FACTS
The judgment dissolving the 13 1/2-year marriage of Robert and Betty Doud was entered on September 10, 1980. On June 2, 1981, they stipulated to a judgment dividing their claimed and disputed marital property but reserving a resolution of the status of the military pension pending a decision in McCarty. The stipulated judgment provided that "[t]he court specifically reserves jurisdiction over the division of the non-vested United States Air Force Retirement benefits, pending the decision of the United States Supreme Court in In Re the Marriage of McCarty ... and in the event that the court decides that military retirement pay is not divisible as a community property asset by California courts, there shall be a determination that there is no *517 community interest in the United States Air Force retirement benefits." This judgment was entered on August 18, 1981. No appeal was taken from it.
On March 20, 1984, Betty, relying upon Civil Code section 5124, moved to modify the judgment to divide the pension as marital property. Robert opposed this motion and moved to set aside the entire judgment should Betty prevail. After argument of the matter the trial court granted Betty's motion and denied Robert's. Betty was awarded an interest in the military retirement benefits. This appeal followed.

DISCUSSION

I
(1a) McCarty held that "there is a conflict between the terms of the federal retirement statutes and the [California] community property right asserted" and that the federal law preempts state law. (453 U.S. at p. 232 [69 L.Ed.2d at p. 605].) This interpretation became a binding part of the federal statute and must be viewed as an integral part of the statute since its inception. (See Sharpe v. Superior Court (1983) 143 Cal. App.3d 469, 474, fn. 3 [192 Cal. Rptr. 16].) Since this statute was in effect during Robert and Betty's marriage and governed the distribution of the federal military pension acquired through Robert's service in the Air Force, it preempted the application of the California community property laws. (Cf. In re Marriage of Brown (1976) 15 Cal.3d 838 [126 Cal. Rptr. 633, 544 P.2d 561, 94 A.L.R.3d 164]; In re Marriage of Fithian (1974) 10 Cal.3d 592 [111 Cal. Rptr. 369, 517 P.2d 449].)
Congress responded with the Federal Uniformed Services Former Spouses' Protection Act (FUSFSPA), effective February 1, 1983. (10 U.S.C. § 1408.) It provides that "a court may treat disposable retired or retainer pay payable to a member for pay periods beginning after June 25, 1981, either as property solely of the member or as property of the member and his spouse in accordance with the law of the jurisdiction of such court." (10 U.S.C. § 1408 (c)(1).) FUSFSPA explicitly authorizes a state to apply its marital property laws to retirement benefits payable after June 26, 1981, and before its effective date.
The committee report accompanying the measure says: "The purpose of this provision is to place the courts in the same position that they were in on June 26, 1981, the date of the McCarty decision, with respect to treatment of non-disability military retired or retainer pay. The provision is intended to remove the federal preemption found to exist by the United States Supreme *518 Court and permit State and other courts of competent jurisdiction to apply pertinent State or other laws in determining whether military retired or retainer pay should be divisable." (Pub.L. No. 97-252 (Sept. 8, 1982) 96 Stats. 730, 1982 U.S. Code Cong. & Admin. News, p. 1611.) On June 26, 1981, California law measured the interests of the spouses in the amounts payable, including those interests preceding that date, by reference to the duration of the marriage. Thus, FUSFSPA sanctions the retroactive recognition of such events.
It is unmistakable that FUSFSPA is meant to remove (with exceptions not pertinent here) the federal preemption discerned in McCarty as of the date of McCarty's promulgation. (2) When a federal statute overrides a state statute under the supremacy clause "the repeal of the federal statute reinstates or revives the state law without an express reenactment by the state legislature." (Fn. omitted.) (1A Sutherland, Statutory Construction (4th ed. 1985 rev.) § 23.21, p. 390; see eg. Boedefeld v. Reed (1880) 55 Cal. 299.) "The result is the same regardless of whether the federal statute is repealed or its repealing effects on state law are expressly rescinded by other congressional action." (1A Sutherland, supra, p. 392, fn. 9 and cases cited therein.) (1b) Accordingly, under FUSFSPA the application of California's community property law was revived and became operative on June 26, 1981.
(3) However, the California law of finality of judgments operated to insulate the application of the community property laws to cases which became final by virtue of judgments and stipulations consummated during the period between McCarty and FUSFSPA. (See In re Marriage of Mahone (1981) 123 Cal. App.3d 17 [176 Cal. Rptr. 274]; In re Marriage of Sheldon (1981) 124 Cal. App.3d 371 [177 Cal. Rptr. 380].) To redress this anomaly the Legislature enacted section 5124. It provides that "[c]ommunity property settlements, judgments, or decrees that became final on or after June 25, 1981, and before February 1, 1983, may be modified to include a division of military retirement benefits payable on or after February 1, 1983, in a manner consistent with federal law and the law of this state as it existed before June 26, 1981, and as it has existed since February 1, 1983." (Stats. 1983, ch. 775, § 1, effective Jan. 1, 1984, through Jan. 1, 1986.)
(4) This change in the law of finality of judgments is within the power of the Legislature, subject to the constraints of the federal and state constitutions. FUSFSPA removed the statutory bar of federal preemption to the exercise of California's power to adopt section 5124. Apparently recognizing this, Robert challenges the constitutionality of section 5124 on other grounds.


*519 II
Robert challenges the constitutionality of section 5124 as impairing a contract contained in the stipulation to apply the McCarty decision to the military pension. The resolution of the claim requires that we examine the content of the agreement.
(5) A husband and wife may contract to allocate their property so as to avoid a judicial resolution of its status and, subject to approval of the family law court, may incorporate the agreement in a judgment. (Civ. Code, § 5103; see Dexter v. Dexter (1954) 42 Cal.2d 36 [265 P.2d 873].) The agreement, subject to contract principles, cannot be modified without the consent of the parties. Here Robert and Betty reached an agreement to divide their marital property. They failed to agree to a division of the pension because they could not agree to its character as separate or marital property.
(6) Robert claims that, by virtue of the agreement, Betty renounced all rights in the military pension. That is not what the agreement provides. Perceiving that a definitive United States Supreme Court resolution of the status of Robert's pension was in the offing, Robert and Betty stipulated to forego a local and possibly ephemeral decision. They agreed to abide by the governing law. Had they done nothing, that would have been the result in any case. The agreement does not show the parties anticipated FUSFSPA and section 5124. We note attorneys are deemed vested with constructive foresight of such events. (See Aloy v. Mash (1985) 38 Cal.3d 413 [212 Cal. Rptr. 162, 696 P.2d 656].) The agreement cannot be read as a renunciation of rights not in being. There is no basis to conclude that the agreement was intended to allocate or compromise the risk of subsequent legislation undoing McCarty. (Compare In re Marriage of Downes (1986) 177 Cal. App.3d 205, 211, fn. 4, 212 [222 Cal. Rptr. 776].) However, the agreement is not without effect. In essence it is an agreement to acquiesce in a binding judgment based on the McCarty decision. Thus the benefit conferred by the agreement is the same as an interest in the finality of a judgment involving a property interest. Robert claims that section 5124 unconstitutionally impairs this interest.

III
That tenders the question of his contractual and vested rights to a final judgment. We first address the question in its contractual form. We assume that the stipulation is a contract subject to the contract clause of the federal Constitution. (See Crane v. Hahlo (1922) 258 U.S. 142, 146 [66 L.Ed. 514, 517, 42 S.Ct. 214]; (7) "It has long been settled by decisions of *520 this court that the word "contracts" in § 10 of article 1 of the Constitution is used in its usual or popular sense, as signifying an agreement of two or more minds, upon sufficient consideration, to do or not to do certain acts.")
(8) Article I, section 10 of the United States Constitution commands that "No State shall ... pass any ... law impairing the obligation of contracts...." Not every encroachment by a law upon rights conferred by a contract unconstitutionally "impairs" the agreement. (See generally, Tribe, American Constitutional Law (1978) §§ 9-6, pp. 467-473.) In Home Building and Loan Asso. v. Blaisdell (1934) 290 U.S. 398 [78 L.Ed. 413, 54 S.Ct. 231, 88 A.L.R. 1481], the Supreme Court discussed the reasons for the contract clause, notably the concern with legislative interference with debtor-creditor relationships and the resulting commercial havoc. The court said: "Not only is the constitutional provision qualified by the measure of control which the State retains over remedial processes, but the State also continues to possess authority to safeguard the vital interests of its people. It does not matter that legislation appropriate to that end `has the result of modifying or abrogating contracts already in effect.' Stephenson v. Binford, 287 U.S. 251, 276, 77 L.Ed. 288, 301, 53 S.Ct. 181, 87 A.L.R. 721."[2] (Id., at pp. 434-435 [78 L.Ed. at pp. 426-427]; fn. omitted.) Thus whether a contract is impaired in the constitutional sense depends upon the public interest in and the reasonableness and necessity of the legislative action.
(9) The analysis is similar to that involved in the determination whether a retroactive statute violates due process by impermissibly impairing vested rights. (See Hochman, The Supreme Court and the Constitutionality of Retroactive Legislation (1960) 73 Harv.L.Rev. 692, 695; Hale, The Supreme Court and the Contract Clause: III (1944) 57 Harv.L.Rev. 852, 890-891[3]; see also Veix v. Sixth Ward Assn. (1940) 310 U.S. 32, 41 [84 L.Ed. 1061, 1067, 60 S.Ct. 792].) Both questions involve an inquiry whether the state has unreasonably deprived an individual of a property right.
*521 "In determining whether a retroactive law contravenes the due process clause, we consider such factors as the significance of the state interest served by the law, the importance of the retroactive application of the law to the effectuation of that interest, the extent of reliance upon the former law, the legitimacy of that reliance, the extent of actions taken on the basis of that reliance, and the extent to which the retroactive application of the new law would disrupt those actions." (In re Marriage of Bouquet (1976) 16 Cal.3d 583, 592-593 [128 Cal. Rptr. 427, 546 P.2d 1371]; see also In re Marriage of Buol (1985) 39 Cal.3d 751 [218 Cal. Rptr. 31, 705 P.2d 354].)
Of significant concern is the degree to which reliance has been placed on the right. (See Fabian v. Fabian (1986) 41 Cal.3d 440, 446-447 [224 Cal. Rptr. 333, 715 P.2d 253]; Fluornoy v. State of California (1964) 230 Cal. App.2d 520, 533 [41 Cal. Rptr. 190].) (10) Prior to McCarty military pension rights were community assets under California law. Thus, during the time that Robert was acquiring his rights in the pension by military service during marriage there could have been no reasonable belief that he was acquiring a separate property right in California. Congress enacted FUSFSPA just 18 months after McCarty. Thus, even where some military service during marriage was rendered post-McCarty a military spouse had no long-settled expectation that he or she would have an exclusive interest in a military pension.
Moreover, Robert's interest is outweighed by the public interest in the enactment of section 5124. (See fn. 3, ante.) FUSFSPA was made retroactive to pay periods after June 25, 1981. Section 5124 implements FUSFSPA's statutory scheme for cases which were final prior to FUSFSPA's effective date, February 1, 1983. This results in equal treatment for those individuals whose cases were fortuitously resolved in the 18-month hiatus between McCarty and FUSFSPA. (Cf. Fabian v. Fabian, supra, 41 Cal.3d at pp. 448-449.) Section 5124 effectuates a purpose of FUSFSPA to authorize equal treatment of military retirement benefits payable after June 25, 1981. (See Aloy v. Mash, supra, 38 Cal.3d at pp. 421-422; In re Marriage of Frederick (1983) 141 Cal. App.3d 876, 879 [190 Cal. Rptr. 588]; see also Mueller v. Walker (1985) 167 Cal. App.3d 600, 609 [213 Cal. Rptr. 442].) (11) "The state's interest in the equitable dissolution of the marital relationship supports this use of the police power to abrogate rights in marital property that derived from the patently unfair former law." (In re Marriage of Buol, supra, 39 Cal.3d at p. 761; quoting from Marriage of Bouquet, supra, 16 Cal.3d at p. 594.)
The state's purpose serves not only its own view of the equities but also the federal one. Robert does not tender a constitutional challenge to FUSFSPA *522 itself and hence claims no right predicated upon federal law.[4] Rather, because the effect of the stipulation was to attribute finality to the judgment which incorporated the agreement, the contract interest he claims is equivalent to the vested interest achieved by application of principles of res judicata. We thus look to the constitutionality of section 5124 as impairing his rights in the finality of the judgment.

IV
(12) Res judicata gives "certain conclusive effect to a former judgment in subsequent litigation involving the same controversy." (4 Witkin, Cal. Procedure (2d ed. 1971) Judgment, § 147, p. 3292; original italics.) The public policy served is the protection of the parties from endless litigation. However, the doctrine "will not be applied so rigidly as to defeat the ends of justice or important considerations of policy." (Greenfield v. Mather (1948) 32 Cal.2d 23, 35 [194 P.2d 1] questioned but not overruled in Slater v. Blackwood (1975) 15 Cal.3d 791, 796 [126 Cal. Rptr. 225, 543 P.2d 593]; see also Mueller v. Walker, supra, 167 Cal. App.3d at p. 607, Deas v. Knapp (1981) 29 Cal.3d 69, 79 [171 Cal. Rptr. 823, 623 P.2d 775], Hight v. Hight (1977) 67 Cal. App.3d 498, 503-504 [136 Cal. Rptr. 685].) The test is whether there is a "rational basis for legislative modification of res judicata rules...." (Deas v. Knapp, supra, 29 Cal.3d at p. 79.)
(13) For the reasons previously advanced we conclude the nullification of the res judicata effect of the judgment here is not unreasonable. "[T]he state's `paramount interest' in the equitable distribution of marital property upon dissolution of the marriage points to section 5124 as proper exercise of the police power." (Mueller v. Walter, supra, 167 Cal. App.3d at p. 609.)

V
That brings us to Robert's alternate contention that the trial court should have granted his motion to set aside the entire agreement to permit him to litigate all of the property issues settled by it.

A.
Robert's opposition papers include his declaration which avers in pertinent part: "[Robert] states that even under the original situation where [he] kept *523 his military retirement benefits, the stipulation represented an unequal division of community property. There is no language in the stipulation where both parties state that it represents an equal division. [Betty] received more than her fair share of the community property; she got the house and [Robert] got an $8,000 non-interest note on the house, due only if [she] decides to sell the house and therefore virtually useless to him. [Betty] received the best of the furniture and personal items. Income and Expenses Declarations filed in May 1981 prior to the judgment, show [Betty's] gross monthly pay as $1,766 [the declaration in fact shows $1,500] and [Robert's] gross monthly earnings as $1,272. [She] received custody of the two children and a total of $300 child support from [Robert]. This represented almost one-third of his disposable pay. Thus, the overall effect of the stipulated division was an unequal division of community property with the [Betty] receiving more."
During the hearing Robert testified that under the settlement he accepted an interest-free promissory note for $8,000 payable when Betty sells her residence in which the community equity had been $20,000. His counsel then asked about the division of personal property under the settlement. Betty objected that these matters were irrelevant and immaterial. Robert's counsel noted his alternative motion and submitted that the division under the settlement occurred because Robert was virtually certain McCarty would come out in his favor. The trial court opined that Robert had no right to rely upon such an expectation. The following colloquy ensued:
"THE COURT: So you see, it's unless you have a basis for it. No, I'm not going to open that up, [counsel].
The only reason I've permitted it this far was the exercise of discretion concerning any retroactivity that might be involved.
But you have alleged that it was not an exactly equal division. But you say that if the Supreme Court had decided it was community property it would have been an equal division?
"[Robert's counsel]: But I'm not talking about the retirement.
"THE COURT: I'm talking about all of it.
"[Robert's counsel]: Okay. [Betty's counsel] has said two or three times that the thirteen point five percent would be an equal division of the retirement if McCarty said it was community. That's true.
*524 "THE COURT: It would be. Either way it would be equal because if it's separate property it has to be equal. The community being divided was equal.
"[Robert's counsel]: But the rest of the division, the personal property, the real property, the rest of the division was unequal. And it was unequal because it was assumed he would receive the retirement. So if you put it all together, it is unequal. She's getting a greater share of the real property. She's getting a greater share of the personal property.
"THE COURT: Does he say that his agreement is based upon this assumption and is only valid if that assumption is 
"[Robert's Counsel]: Yes. He 
"THE COURT: No, he does not say that.
"[Robert's Counsel]: Well, he doesn't. But he said I will divide the property this way, the personal property and the real property, even though it is unequal as long as we agree that we will be bound by the McCarty decision." The trial court was not persuaded that further testimony on asserted inequalities was appropriate.

B.
(14) Section 5124 only confers authority to modify to include a division of military retirement benefits. However, under section 5124 the trial court has discretion to deny such modification on equitable grounds. (See In re Marriage of Downes, supra, 177 Cal. App.3d at pp. 209-210.) Thus, the trial court may condition the grant of modification upon agreement of the moving party to do equity. (C.f. Hill v. Hattrem (1981) 117 Cal. App.3d 569, 574-576 [172 Cal. Rptr. 806]; see generally In re Marriage of Milhan (1980) 27 Cal.3d 765, 779-780 [166 Cal. Rptr. 533, 613 P.2d 812]; Code Civ. Proc., § 473 [relief from default "upon such terms as may be just"]; Rest., Restitution, § 74.) Was the trial court constrained to find that equity required Betty to agree to reopen the remainder of the settlement as the price for modification of the pension right adjudication? The answer is no.
(15) Initially, we note that the matter arises on a motion seeking modification of the judgment. The evidentiary grist for the court's mill in such a proceeding is declarations, subject to the court's discretion to allow or deny oral testimony. (See e.g. Cal. Rules of Court, rule 323; Reifler v. Superior Court (1974) 39 Cal. App.3d 479, 483-484 [114 Cal. Rptr. 356]; 6 Witkin, Cal. Procedure (3d ed. 1985) Proceedings Without Trial, §§ 27-31.) *525 Robert's showing by declaration regarding the claimed substantial unequal division of the remainder of the marital property under the stipulation is conclusary and wholly inadequate. We also note that Robert made no offer of proof concerning the testimony that he would have adduced concerning the division of personal property under the stipulation if he had been allowed to do so. This places his claim of inequitable division of the marital property in a very unsympathetic posture.[5]
Accepting for the sake of argument his claim of some inequality, it appears the trial court did not find the equities to weigh in his favor. Reopening the entire stipulated settlement would impose significant burdens on Betty, which presents a contrary equitable consideration. Tracing and valuation problems would be difficult, if not impossible, and long-settled expectations would be upset. As to the latter consideration, sympathy for Robert's upset expectations does not a fortiori make it just to unsettle those of Betty as to the other marital property. Robert was willing to divide that property under the settlement scheme without recourse, if McCarty had reaffirmed existing precedents. The trial court found his complaint, when FUSFPA and section 5124 did what McCarty might well have done, an insufficient equity to compel reopening of the entire settlement.[6] The equitable discretion that is afforded by section 5124 is, in the first instance, assigned to the trial court. The standard for review of the decision of the trial court is that of abuse of discretion. (Cf. 8 Witkin, Cal. Procedure (3d ed. 1985) Attack on Judgment in the Trial Court, § 180; see generally, 9 Witkin, Cal. Procedure (3d ed. 1985) Appeal, §§ 275-277.) Weighing the competing equities in a section 5124 case is best accomplished by the trier of fact. We discern no abuse of discretion in the ruling here that Robert was not entitled to demand reopening of the entire settlement as the price of modification of the judgment regarding the military pension. (See generally Rest.2d, Contracts, §§ 183, 240.)
The order from which Robert appeals is affirmed.
*526 Sparks, J., concurred.
PUGLIA, P.J.
I dissent. The parties were aware that the case of McCarty v. McCarty (1981) 453 U.S. 210 [69 L.Ed.2d 589, 101 S.Ct. 2728] would soon be decided by the U.S. Supreme Court. Referring expressly to that case, they stipulated that if the Supreme Court ruled military retirement pay was not divisible as community property, wife would receive no community interest in husband's military retirement benefits. The Supreme Court ruled in McCarty that military retirement pay was the separate property of the military spouse (453 U.S. at pp. 232-236 [69 L.Ed.2d at pp. 605-608]). Judgment of dissolution was entered incorporating the stipulation. That judgment has long since become final.
The majority holds that Civil Code section 5124 may be retroactively applied fundamentally to modify that final judgment to the wife's advantage and the husband's substantial detriment. In my view section 5124, as applied here, unconstitutionally impairs the obligation of contract and deprives husband of vested property rights without due process of law.
Congress responded to the McCarty decision by enacting Senate Bill No. 1814, which became the Federal Uniformed Services Former Spouses' Protection Act (FUSFSPA). (10 U.S.C. § 1408.) Effective February 1, 1983, FUSFSPA nullifies the preemptive effect of the federal statutes interpreted in the McCarty decision, allowing state courts to treat military retirement benefits either as separate or community property in accordance with the law of the particular jurisdiction. (10 U.S.C. § 1408(c)(1).) Although FUSFSPA in terms applies retroactively to June 26, 1981, the date McCarty was decided (1982 U.S. Code Cong. & Admin. News, at pp. 1599-1600; In re Marriage of Ankenman (1983) 142 Cal. App.3d 833, 837 [191 Cal. Rptr. 292]; In re Marriage of Buikema (1983) 139 Cal. App.3d 689, 691 [188 Cal. Rptr. 856]), it has been held applicable only to those cases not yet final as of its effective date, February 1, 1983. (In re Marriage of Hopkins (1983) 142 Cal. App.3d 350, 360 [191 Cal. Rptr. 70]; In re Marriage of Fairfull (1984) 161 Cal. App.3d 532, 535 [207 Cal. Rptr. 523]; Mueller v. Walker (1985) 167 Cal. App.3d 600, 605 [213 Cal. Rptr. 442].) Thus, so far as FUSFSPA is concerned, McCarty remains a viable rule of decision as to those judgments which became final during the 19-month interval between its announcement and the effective date of FUSFSPA. (Mueller, supra, 167 Cal. App.3d at p. 606.)
To bridge this gap the Legislature enacted Civil Code section 5124,[1] which allows community property settlements, judgments or decrees that *527 became final on or after June 25, 1981, and before February 1, 1983, to be modified to include a division of military retirement benefits payable on or after February 1, 1983, as community property. (Stats. 1983, ch. 775, § 1, eff. Jan. 1, 1984, through Jan. 1, 1986.) Section 5124 operates to reopen judgments which became final after McCarty and prior to FUSFSPA's effective date in order to extend the ameliorative benefits of the federal statute.

I
Husband contends the application of section 5124 to this case unconstitutionally impairs the obligation of contract. A husband and wife may divide their property as they choose pursuant to a property settlement agreement, regardless of how the law otherwise would characterize and divide the property. These agreements are favored by law. (§§ 5103, subd. (a); 4800, subd. (a); Adams v. Adams (1947) 29 Cal.2d 621, 624 [177 P.2d 265]; Dexter v. Dexter (1954) 42 Cal.2d 36, 40 [265 P.2d 873].) In the absence of fraud or compulsion, such agreements are valid and binding on the court and cannot be modified without the consent of the parties. (Adams, supra, at pp. 624-625.)
There is no evidence of fraud or compulsion here. The parties entered into a stipulated judgment which was placed on the record in open court. The stipulation apparently allocated all the property of the parties, consisting of automobiles, bank accounts, insurance policies, household furnishings, other personal property and real estate. Included in the latter category was the family residence which was allocated to wife on condition only that she "give the respondent [husband] $8,000 of the sale proceeds when it is sold," there being "no time frame for when it is to be sold." No values were ascribed to the various assets and it cannot be determined whether the division was equal. As an integral part of the agreement, the parties agreed to hazard the retirement benefits on the outcome of McCarty.
By entering into such a property settlement agreement, a contract arose. Although wife did not expressly renounce all rights in the retirement pay, she and husband each undertook to abide by the outcome of McCarty with respect to its allocation. The parties are entitled to expect that their contract will be performed, and each is bound to its terms based on these settled expectations. (Cf. Sharpe v. Superior Court (1983) 143 Cal. App.3d 469, 472 [192 Cal. Rptr. 16]; In re Marriage of Mahone (1981) 123 Cal. App.3d 17, 21-22 [176 Cal. Rptr. 274]; In re Marriage of Sheldon (1981) 124 Cal. App.3d 371, 383-384 [177 Cal. Rptr. 380].)
The United States and California Constitutions each prohibit laws which impair the obligation of contract. (U.S. Const., art. I, § 10, cl. 1; Cal. *528 Const., art. I, § 9.) However, the constitutional contract clauses are not absolute; they must be accommodated to the police power of the state "to safeguard the vital interests of its people." (Home Building & Loan Asso. v. Blaisdell (1934) 290 U.S. 398, 434-435 [78 L.Ed. 413, 426-427, 54 S.Ct. 231, 88 A.L.R. 1481]; see also Valdes v. Cory (1983) 139 Cal. App.3d 773, 789 [189 Cal. Rptr. 212].)
The United States Supreme Court follows a three-step analysis of contract impairment claims. First, the state law must operate "as a substantial impairment of a contractual relationship." Second, if there is a substantial impairment, "the State, in justification, must have a significant and legitimate public purpose behind the regulation." Third, if a legitimate public purpose exists, the adjustment of rights and responsibilities of the contracting parties must be based upon "reasonable conditions" and "of a character appropriate to the public purpose justifying [the legislation's] adoption. [Citations.]" (Energy Reserves Group v. Kansas Power & Light (1983) 459 U.S. 400, 411-413 [74 L.Ed.2d 569, 580-581, 103 S.Ct. 697]; see also Rue-Ell Enterprises, Inc. v. City of Berkeley (1983) 147 Cal. App.3d 81, 87-89 [194 Cal. Rptr. 919]; Interstate Marina Development Co. v. County of Los Angeles (1984) 155 Cal. App.3d 435, 445-446 [202 Cal. Rptr. 377].)
Here the modification permitted by section 5124 effectively eviscerated the agreement. The parties agreed husband's military retirement pay would be his sole property if the McCarty decision ruled on that issue in favor of military retirees. The condition precedent to husband's realization of his rights under the contract had long since occurred when wife moved to modify the judgment. The modification deprives husband of substantial benefits for which he bargained without relieving him of any of the obligations; at the same time it permits wife to repudiate a material obligation of the contract while retaining all the benefits. The modification, without consent of husband, inevitably frustrated his settled expectations. It is beyond dispute that the impairment is substantial.
Since there is substantial impairment the inquiry focuses on whether there is adequate justification in the nature of a significant and legitimate public purpose which is furthered by the application of section 5124 to these circumstances. The asserted justification for the impairment is the state interest in effectuating the legislative intent of FUSFSPA, thus eliminating the hardships suffered by a class of persons whose property settlement agreements, by chance, became final during the period between McCarty and FUSFSPA. (Leg. Counsel's Dig. of Sen. Bill No. 1034 (1983-1984 Reg. Sess.); Mueller v. Walker, supra, 167 Cal. App.3d at p. 609.) Uniform application of FUSFSPA would thus insure equal treatment for those individuals whose cases fortuitously were resolved during the reign of McCarty. *529 This state interest in the equitable distribution of marital property is significant and legitimate (see Mueller, supra, 167 Cal. App.3d at p. 609) and in some cases may well justify the reopening of final judgments as an appropriate means to advance this public purpose.
In this case, however, there is no state interest which would justify a substantial impairment of contract. Wife does not fall within the class of persons who by chance suffered inequities by virtue of McCarty. First, as part of an overall property settlement she agreed to wait until McCarty was decided before a determination was made of the status of husband's retirement benefits; second, she agreed that the outcome of McCarty would control that determination. Because these choices were freely made in the context of mutual undertakings, no inequities or hardships have fortuitously been inflicted upon wife which would justify state interference with the contract. To the contrary, the settled and strong expectations of the parties contemplated that on the happening of the condition precedent in a certain way, husband would receive the sole right to the retirement benefits. Because of the lack of any justifiable state interest in interfering with the performance of this agreement, the application of section 5124 here is an unconstitutional impairment of contract.

II
Husband contends the retroactive application of section 5124 here results in an unconstitutional deprivation of vested rights without due process of law.
Husband's right to sole ownership of his retirement benefits became vested when, after the McCarty decision, the stipulated judgment became final. At that point the right to the retirement benefits was no longer subject to a condition precedent. (See In re Marriage of Bouquet (1976) 16 Cal.3d 583, 591, fn. 7 [128 Cal. Rptr. 427, 546 P.2d 1371].)
However, vested rights, like contract rights, are not absolutely inviolable at the hands of the state. A state in the exercise of its police power may impair such rights "`whenever reasonably necessary to the protection of the health, safety, morals, and general well being of the people.... [¶] The constitutional question, on principle, therefore, would seem to be, not whether a vested right is impaired by a marital property law change, but whether such a change reasonably could be believed to be sufficiently necessary to the public welfare to justify the impairment.'" (Addison v. Addison (1965) 62 Cal.2d 558, 566 [43 Cal. Rptr. 97, 399 P.2d 897, 14 A.L.R.3d 391], quoting Armstrong, "Prospective" Application of Changes in Community Property Control  Rule of Property or Constitutional Necessity? *530 (1945) 33 Cal.L.Rev. 476, 495; see also Bouquet, supra, 16 Cal.3d at p. 592.)
"In determining whether a retroactive law contravenes the due process clause, we consider such factors as the significance of the state interest served by the law, the importance of the retroactive application of the law to the effectuation of that interest, the extent of reliance upon the former law, the legitimacy of that reliance, the extent of actions taken on the basis of that reliance, and the extent to which the retroactive application of the new law would disrupt those actions." (Bouquet, supra, 16 Cal.3d at p. 592; see also In re Marriage of Buol (1985) 39 Cal.3d 751, 761 [218 Cal. Rptr. 31, 705 P.2d 354].) Where retroactive application is necessary to serve a sufficiently important state interest, the inquiry need go no further. (Buol, supra, 39 Cal.3d at p. 761.) The state's interest in the equitable dissolution of the marital relationship has been held to be sufficiently important to justify retroactive legislation to "remedy `the rank injustice of the former law'" (Boul, supra, 39 Cal.3d at p. 761, quoting Bouquet, supra, 16 Cal.3d at p. 594, and Addison, supra, 62 Cal.2d at p. 567), and to abrogate rights in marital property that derived from patently unfair former law. (Bouquet, supra, 16 Cal.3d at p. 594.) Thus, application of section 5124 to modify a final judgment may be justified when the parties by happenstance fall within the McCarty interregnum, subjecting one of them to the "rank injustice" of deprivation of marital property rights from the "patently unfair former law" announced in McCarty.
As already indicated, retroactive application of section 5124 in these circumstances does not advance any legitimate state interest. Wife is not the victim of rank injustice, nor is the judgment the product of an unfair law. Wife's rights under the judgment arise not from the law but from her agreement, freely entered, to accept the decision in McCarty, whatever it may be, as the final determinant of her rights in husband's military retirement pay. Wife was not forced to accept the ultimate outcome in McCarty as controlling law; rather she agreed to do so as part of an overall settlement of property rights.
The majority deems significant the degree of reliance placed on the vested right, concluding husband was not entitled to any long-settled expectation that his pension would be his separate property because prior to McCarty pension rights were community assets in California and Congress enacted FUSFSPA only 19 months after McCarty. This conclusion miscontrues the nature and extent of husband's reliance. His expectations derived from the marital property settlement agreement, not from pre-McCarty law. Husband ordered his affairs in reliance on the judgment for two and one-half years. *531 In view of the constitutional protection accorded contractual obligations and vested property rights, his reliance was reasonable.
The majority characterizes husband's stake as an interest in vested rights derived from principles governing finality of judgments and res judicata. The state interest of course is in effecting an equitable division of marital property as to those who would otherwise fortuitously be divested by McCarty. The majority concludes the state interest is sufficiently important to justify nullification of the res judicata effect of the judgment here. For reasons already stated, the state interest in the application of section 5124 is irrelevant to these facts and thus cannot outweigh husband's interest in the finality of judgments. "[F]inality in dissolution proceedings is extremely important from the standpoint of the human beings involved...." and the interests of the parties or society are not served by disrupting settled expectations. (In re Marriage of Sheldon, supra, 124 Cal. App.3d at p. 383.) Res judicata is designed to put "... an end to litigation and even erroneous final judgments must be honored in order to continue the `well-ordered functioning of the judicial process.'" (In re Marriage of Fellers (1981) 125 Cal. App.3d 254, 257 [178 Cal. Rptr. 35], quoting Slater v. Blackwood (1975) 15 Cal.3d 791, 797 [126 Cal. Rptr. 225, 543 P.2d 593].) Although legislation may modify res judicata rules when based on a reasonable public policy or other rational basis (Mueller, supra, 167 Cal. App.3d at p. 607; see also Deas v. Knapp (1981) 29 Cal.3d 69, 79 [171 Cal. Rptr. 823, 623 P.2d 775]), the absence of a reasonable public policy rationale here precludes the application of section 5124 to avoid the res judicata effect of the judgment.
Retroactive application of section 5124 here unconstitutionally impairs the obligation of contract and deprives husband of vested rights without due process of law. I would reverse the order of modification.
A petition for a rehearing was denied June 17, 1986. Puglia, P.J., was of the opinion that the petition should be granted.
NOTES
[1]  All further references to sections are to the Civil Code unless otherwise indicated.
[2]  Not every encroachment can be justified, however, particularly when the challenged statute alters the state's own obligation of payment. (See United States Trust Co. v. New Jersey (1977) 431 U.S. 1 [52 L.Ed.2d 92, 97 S.Ct. 1505]; see also California Teachers Assn. v. Cory (1984) 155 Cal. App.3d 494, 511-512 [202 Cal. Rptr. 611].)
[3]  "[T]here is at least a tendency for the contract clause and the due process clause to coalesce. Although there is no clause expressly forbidding the federal government to pass laws impairing the obligation of contracts, any federal law impairing them in a manner which the Supreme Court deemed unreasonable would doubtless be held to be a deprivation of property without due process.... And a state law which impaired obligations in a manner which the Court deemed reasonable would be held valid. The fact that a person is deprived of a contract right rather than a different sort of property may make legislation seem to the judges more, or less, reasonable in a particular case. But the results might be the same if the contract clause were dropped out of the Constitution, and the challenged statutes all judged as reasonable or unreasonable deprivations of property." (Hale, The Supreme Court and the Contract Clause, supra, 57 Harv.L.Rev. at pp. 890-891.)
[4]  This case does not tender the difficult question whether the dispossession of monies actually received prior to enactment of FUSFSPA is unconstitutional. In this case the modification order awarded Betty a community interest prospectively, as of April 1, 1984, rather than the date permitted by FUSFSPA, June 26, 1981.
[5]  That he agreed to a note for $8,000 payable on sale in exchange for his interest in the single-family residence occupied by Betty is hardly compelling. He did claim the equity in the house was $20,000. However, what the date of purported valuation was is unstated. The house was purchased for $39,000 as the residence of Betty and the children after the marital separation in July 1978. All payments, save the down payment were made by Betty. Betty used $4,810.17 of community funds for the down payment. The funds had been allocated to her under an agreement of the parties (subsequently rescinded) which contemplated that the house would be hers. Robert previously had quitclaimed his interest to Betty under the representation he would be given an appropriate credit for "these funds."
[6]  We imply no view of the equitable claim of the analogous but more typical section 5124 military spouse, one who made a settlement post-McCarty. We note that such a person would have a superior claim for relief since they would be acting in reliance upon the unquestioned law. This is a consideration that our dissenting colleague appears to find to cut in the opposite direction.
[1]  All references hereinafter to sections of an unspecified code are to the Civil Code.
