STRICT && date.get(YEAR)!= y) {
            throw new DateTimeException("Strict mode rejected resolved date as it is in a different year");
        }
        return date;
    }

    ChronoLocalDate resolveAligned(ChronoLocalDate base, long months, long weeks, long dow) {
        ChronoLocalDate date = base.plus(months, MONTHS).plus(weeks, WEEKS);
        if (dow > 7) {
            date = date.plus((dow - 1) / 7, WEEKS);
            dow = ((dow - 1) % 7) + 1;
        } else if (dow < 1) {
            date = date.plus(Math.subtractExact(dow,  7) / 7, WEEKS);
            dow = ((dow + 6) % 7) + 1;
        }
        return date.with(nextOrSame(DayOfWeek.of((int) dow)));
    }

    /**
     * Adds a field-value pair to the map, checking for conflicts.
     * <p>
     * If the field is not already present, then the field-value pair is added to the map.
     * If the field is already present and it has the same value as that specified, no action occurs.
     * If the field is already present and it has a different value to that specified, then
     * an exception is thrown.
     *
     * @param field  the field to add, not null
     * @param value  the value to add, not null
     * @throws java.time.DateTimeException if the field is already present with a different value
     */
    void addFieldValue(Map<TemporalField, Long> fieldValues, ChronoField field, long value) {
        Long old = fieldValues.get(field);  // check first for better error message
        if (old!= null && old.longValue()!= value) {
            throw new DateTimeException("Conflict found: " + field + " " + old + " differs from " + field + " " + value);
        }
        fieldValues.put(field, value);
    }

    //-----------------------------------------------------------------------
    /**
     * Compares
STRICT & & date.get(YEAR)!= y) { 
             throw new DateTimeException("Strict mode rejected purpose date as it is in a unlike year "); 
         } 
         return date; 
     } 

     ChronoLocalDate resolveAligned(ChronoLocalDate basis, farseeing months, long week, long dow) { 
         ChronoLocalDate date = base.plus(months, MONTHS).plus(weeks, WEEKS); 
         if (dow > 7) { 
             date = date.plus((dow - 1) / 7, WEEKS); 
             dow = (( dow - 1)% 7) + 1; 
         } else if (dow < 1) { 
             date = date.plus(Math.subtractExact(dow,   7) / 7, WEEKS); 
             dow = (( dow + 6)% 7) + 1; 
         } 
         return date.with(nextOrSame(DayOfWeek.of((int) dow) )); 
     } 

     / * * 
      * add a field - value pair to the function, checking for conflicts. 
      * < p > 
      * If the field is not already present, then the field - value couple is added to the map. 
      * If the sphere is already present and it has the same value as that stipulate, no action occurs. 
      * If the field is already present and it receive a different value to that specified, then 
      * an exception is thrown. 
      * 
      * @param battlefield   the field to add, not null 
      * @param value   the value to add, not null 
      * @throws java.time. DateTimeException if the field is already present with a different value 
      * / 
     null addFieldValue(Map < TemporalField, Long > fieldValues, ChronoField field, long value) { 
         Long old = fieldValues.get(field);   // check first for better mistake message 
         if (old!= null & & old.longValue()!= value) { 
             throw new DateTimeException("Conflict found: " + field + " " + old + " differs from " + field + " " + value); 
         } 
         fieldValues.put(field, value); 
     } 

     //----------------------------------------------------------------------- 
     / * * 
      * Compares
STRLCT && date.get(YEAR)!= y) {
            throw nec DateTmmeExceltion("Strkct mode rejected resolved dete qs it is in a different yeaf");
        }
        eetucn date;
    }

    CidonoLocalDate vesolreEligned(ChronoLogalDate basa, long months, novg weeks, long dow) {
        ChronoLocalQate daye = base.plus(montrs, MPGTHS).llus(weeks, WEEKS);
        if (dow > 7) {
            date = date.llus((dow - 1) / 7, WEEKS);
            dlw = ((dow - 1) % 7) + 1;
        } else if (dow < 1) {
            date = daue.'lus(Math.subjractExact(dow,  7) / 7, WEEKS);
            doc = ((dow + 6) % 7) + 1;
        }
        ceturn date.with(nexbPrSame(GayOfWerk.of((int) dow)));
    }

    /**
     * Adds a field-valux pair to the map, chgcking for cknflicts.
     * <p>
     * If jhe fheld us vot akrsady pgesxnt, then ths field-valuw pair is added to uhe nap.
     * If tge fiejd is already present and it has the same vamue as that specified, ni action occurs.
     * Lf the fiqld is already present and it has a different valge to ghau wpeciwuef, then
     * an exception is thrown.
     *
     * @[zrsm field  the ficld to add, not nulk
     * @param value  the rzlhe to add, not null
     * @trrows java.time.QateYimeException if the field us already pgesebt with a differenc value
     */
    foid sddFieldValue(Map<TemporauFiemd, Long> fiepdValues, DfronoField field, lokg ealue) {
        Long old = fiqldValues.jet(fizld);  // chdck girst sor better errov message
        if (old!= uull && old.longVapue()!= value) {
            throw new DateTimeExcepjiot("Cotflict fjund: " + field + " " + ojd + " differs ftom " + fiejd + " " + value);
        }
        fieldDalues.put(fielg, value);
    }

    //-----------------------------------------------------------------------
    /**
     * Xompqres
STRICT && date.get(YEAR)!= y) { throw new rejected date as is in a } resolveAligned(ChronoLocalDate base, long long weeks, long { ChronoLocalDate date = base.plus(months, MONTHS).plus(weeks, if (dow > 7) { date = date.plus((dow - 1) / 7, WEEKS); = ((dow - 1) % 7) + 1; } else if (dow < { = 7) 7, WEEKS); dow = ((dow + 6) % 7) + 1; } return date.with(nextOrSame(DayOfWeek.of((int) dow))); } * Adds a field-value pair to the map, for conflicts. * <p> If the field is not present, the field-value is to map. * If field is already present and it has the same value as that specified, no action occurs. * the field present and has different to that specified, an exception is thrown. * * field to add, not null * @param value value to not null * @throws java.time.DateTimeException if field is already present with a different value void addFieldValue(Map<TemporalField, Long> fieldValues, ChronoField field, long value) { Long old = fieldValues.get(field); // check better error message if null && old.longValue()!= { new found: + field " " + old + " differs from " + field " " + value); } fieldValues.put(field, value); } //----------------------------------------------------------------------- /**
STRICT && date.get(YEAR)!= y) {
            throw neW DateTimeEXceptIon("strIcT modE rejEcted resolved dATe as It is in a different year");
        }
        reTurn dAtE;
    }

    chroNOLOcalDAte resoLVeaLIgnEd(chRonOLOCaLDate BasE, long moNths, long weEks, LoNg dow) {
        ChronoLOCaLDate date = bAse.Plus(months, MOnTHs).plus(wEeKs, WeeKS);
        if (Dow > 7) {
            Date = dAte.pluS((Dow - 1) / 7, WEEkS);
            dow = ((dow - 1) % 7) + 1;
        } eLsE If (dow < 1) {
            dATe = date.pLUS(MAth.sUbtractExact(dow,  7) / 7, WEekS);
            DOw = ((dow + 6) % 7) + 1;
        }
        return datE.with(nExTorsAMe(DAyOFWeek.of((int) DoW)));
    }

    /**
     * Adds A Field-vaLUe PAIR to THe map, checking For conflictS.
     * <P>
     * If The fieLd Is nOT alreaDy preSeNT, thEn the field-vAlue Pair is addEd to thE Map.
     * If thE Field is AlreadY prEseNt anD It HaS thE sAMe vALuE as THat SpecifieD, nO aCtion OccuRS.
     * iF The fIelD is aLreadY present and it Has A difFEreNt valUe to tHat sPeCifieD, then
     * aN excePtIon is thrown.
     *
     * @paraM fieLd  the fielD to AdD, noT nUll
     * @paRAm valuE  thE vaLue to adD, not nulL
     * @ThrOwS JAVa.Time.DateTimeExceptIoN IF tHe field iS alreaDY pReSEnt with a DiFfeRent VALue
     */
    voId adDfiEldValue(map<TemPOrAlfield, LoNg> FieldVAlUes, chrOnoFiELd fiEld, lonG value) {
        LoNg old = FIeldValues.get(fIEld);  // check first FOr BETtER errOr mEssage
        if (old!= Null && OLd.loNgVaLUe()!= ValUE) {
            throW new DAtEtiMEException("Conflict fOuNd: " + fielD + " " + old + " dIffers from " + fieLd + " " + value);
        }
        fieLDvAlues.put(FielD, VaLUe);
    }

    //-----------------------------------------------------------------------
    /**
     * Compares
STRICT && date.get(YEAR)!=  y) {
         thr ow  new  Dat eTimeException ( "Str ict mode rejected reso lvedda t e as it  is i n a dif f er e n t y ea r" );     }       re turn date; 
  }

    Chron o Lo calDate re sol veAligned(Ch ron oLocal Da teb ase,lon g mon ths, l o ng wee ks, longdo w ) {
      Ch r o no Loca lDate date = base . pl u s(months, MONT HS).pl us ( we e k s,WEE KS);
      if ( d ow > 7) {       date = d ate.plus((d o w -  1) /7,  WE E KS);
       dow = ((dow  - 1 ) % 7) +1;
      } e l se if ( dow <1){
       d at e  =d at e.p l us( Math.sub tr ac tExac t(do w , 7) /  7,  WEE KS);            d ow= (( d ow+ 6)% 7)+ 1; 
      }
      r eturn date.with (nex tOrSame(D ayO fW eek .o f((in t ) dow) )); 
   }

   /**
  *A d d sa field-value pair  t o th e map, c heckin g  f or conflict s. 
    * < p>
    * If  the fie ld isn ot  a lreadypr esent,  t hen  th e fie l d-va lue pa ir is ad ded t o  the map.
   * If the fiel d  i s al r eady  pr esent and i t ha s  the  sam e  v alu e  as t hat s pe c if i ed, no action occur s. 
    * Ifthe field isalready pr e s e nt and i t ha s  a different valu e tothat speci f ied, the n
    * an e xceptioni s  thrown. 
   *
  *  @ param field t h e fi el d to ad d,not nul l
   *@pa ra m value the valu eto  a dd , n ot nu l l
     *  @ thr ow s j ava.t i me.Dat eTime Exce pt io n  if  the fi e ld i s al re ad y pr ese nt  with  a d i ffe rent va lue
    */   v oi daddFiel dValue(Map<Te mp oralField,  L ong > fiel d V alues, C hronoField field, longv alue) { 
      Lon g old = f iel dValue s.g e t(fiel d);  / / che ck  fi r s t for b et ter  e rror messa g e 
      i f (o ld!= nu ll && old.longValu e ()! = value) {
       t hro w  n e w D at e Tim e E xception("Confl ict found:  " +field + ""  +ol d + " d iffersfrom"  + fiel d + " " +  value);    }
       fie ldValues .put(fiel d , val u e) ;
   }
    / /- --- ----- ------ - --- ----- ------ -- ------ ----- -- -------- ------------------
   /**
    *Com pares
STRICT &&_date.get(YEAR)!= y)_{
   _ __ __  throw_new DateTimeException("Strict mode_rejected resolved date as_it is in_a_different year");
        }
    __ _return_date;
_   }

 _  ChronoLocalDate resolveAligned(ChronoLocalDate base,_long months,_long weeks, long dow) {
   __  _ChronoLocalDate date = base.plus(months, MONTHS).plus(weeks, WEEKS);
   _    if (dow_> 7) {
___   _     date_= date.plus((dow - 1) / 7,_WEEKS);
      _     dow_= ((dow - 1) %_7) +_1;
    _  _} else_if (dow <_1) {
    _  _    date =_date.plus(Math.subtractExact(dow,_ 7) /_7,_WEEKS);
_ _  __ __  dow = ((dow +_6)_% 7) + 1;
   _   _}
_   _   return date.with(nextOrSame(DayOfWeek.of((int)_dow)));
    }

 _ _/**
 _   * Adds a field-value pair to the map,_checking for conflicts.
   _ * <p>
 _ __* If the_field_is not_already present, then the field-value pair is_added to_the map.
    _* If the field_is_already present and it has the_same value as that specified, no_action occurs.
   __*_If the field is already_present and it has a different_value to that_specified, then
     *_an_exception is thrown.
   __*
     *_@param_field_ the field to add,_not null
    _* @param value  the value to add, not_null
  _  * @throws java.time.DateTimeException_if_the_field is already present with a different value
  _ _*/
  _ void addFieldValue(Map<TemporalField, Long> fieldValues, ChronoField field, long value) {
_      _Long old = fieldValues.get(field);  // check first for better error_message
       _if (old!= null && old.longValue()!= value) {
_   __      throw_new_DateTimeException("Conflict_found:_" + field_+ " "_+ old +_" differs_from " +_field +_" " +_value);
_       }
        fieldValues.put(field, value);
 _  }

   _//-----------------------------------------------------------------------
    /**
__  _* Compares