@@ -561,19 +561,19 @@ static private void copyEventRecurrenceToModel(final EventRecurrence er,
561
561
}
562
562
}
563
563
564
- static private void copyModelToEventRecurrence (final RecurrenceModel model , EventRecurrence er ) {
564
+ static private void copyModelToEventRecurrence (final RecurrenceModel model , EventRecurrence eventRecurrence ) {
565
565
if (model .recurrenceState == RecurrenceModel .STATE_NO_RECURRENCE ) {
566
566
throw new IllegalStateException ("There's no recurrence" );
567
567
}
568
568
569
569
// Freq
570
- er .freq = mFreqModelToEventRecurrence [model .freq ];
570
+ eventRecurrence .freq = mFreqModelToEventRecurrence [model .freq ];
571
571
572
572
// Interval
573
573
if (model .interval <= 1 ) {
574
- er .interval = 0 ;
574
+ eventRecurrence .interval = 0 ;
575
575
} else {
576
- er .interval = model .interval ;
576
+ eventRecurrence .interval = model .interval ;
577
577
}
578
578
579
579
// End
@@ -582,52 +582,52 @@ static private void copyModelToEventRecurrence(final RecurrenceModel model, Even
582
582
if (model .endDate != null ) {
583
583
model .endDate .switchTimezone (Time .TIMEZONE_UTC );
584
584
model .endDate .normalize (false );
585
- er .until = model .endDate .format2445 ();
586
- er .count = 0 ;
585
+ eventRecurrence .until = model .endDate .format2445 ();
586
+ eventRecurrence .count = 0 ;
587
587
} else {
588
588
throw new IllegalStateException ("end = END_BY_DATE but endDate is null" );
589
589
}
590
590
break ;
591
591
case RecurrenceModel .END_BY_COUNT :
592
- er .count = model .endCount ;
593
- er .until = null ;
594
- if (er .count <= 0 ) {
595
- throw new IllegalStateException ("count is " + er .count );
592
+ eventRecurrence .count = model .endCount ;
593
+ eventRecurrence .until = null ;
594
+ if (eventRecurrence .count <= 0 ) {
595
+ throw new IllegalStateException ("count is " + eventRecurrence .count );
596
596
}
597
597
break ;
598
598
default :
599
- er .count = 0 ;
600
- er .until = null ;
599
+ eventRecurrence .count = 0 ;
600
+ eventRecurrence .until = null ;
601
601
break ;
602
602
}
603
603
604
604
// Weekly && monthly repeat patterns
605
- er .bydayCount = 0 ;
606
- er .bymonthdayCount = 0 ;
605
+ eventRecurrence .bydayCount = 0 ;
606
+ eventRecurrence .bymonthdayCount = 0 ;
607
607
608
608
switch (model .freq ) {
609
609
case RecurrenceModel .FREQ_MONTHLY :
610
610
if (model .monthlyRepeat == RecurrenceModel .MONTHLY_BY_DATE ) {
611
611
if (model .monthlyByMonthDay > 0 ) {
612
- if (er .bymonthday == null || er .bymonthdayCount < 1 ) {
613
- er .bymonthday = new int [1 ];
612
+ if (eventRecurrence .bymonthday == null || eventRecurrence .bymonthdayCount < 1 ) {
613
+ eventRecurrence .bymonthday = new int [1 ];
614
614
}
615
- er .bymonthday [0 ] = model .monthlyByMonthDay ;
616
- er .bymonthdayCount = 1 ;
615
+ eventRecurrence .bymonthday [0 ] = model .monthlyByMonthDay ;
616
+ eventRecurrence .bymonthdayCount = 1 ;
617
617
}
618
618
} else if (model .monthlyRepeat == RecurrenceModel .MONTHLY_BY_NTH_DAY_OF_WEEK ) {
619
619
if (!isSupportedMonthlyByNthDayOfWeek (model .monthlyByNthDayOfWeek )) {
620
620
throw new IllegalStateException ("month repeat by nth week but n is "
621
621
+ model .monthlyByNthDayOfWeek );
622
622
}
623
623
int count = 1 ;
624
- if (er .bydayCount < count || er .byday == null || er .bydayNum == null ) {
625
- er .byday = new int [count ];
626
- er .bydayNum = new int [count ];
624
+ if (eventRecurrence .bydayCount < count || eventRecurrence .byday == null || eventRecurrence .bydayNum == null ) {
625
+ eventRecurrence .byday = new int [count ];
626
+ eventRecurrence .bydayNum = new int [count ];
627
627
}
628
- er .bydayCount = count ;
629
- er .byday [0 ] = EventRecurrence .timeDay2Day (model .monthlyByDayOfWeek );
630
- er .bydayNum [0 ] = model .monthlyByNthDayOfWeek ;
628
+ eventRecurrence .bydayCount = count ;
629
+ eventRecurrence .byday [0 ] = EventRecurrence .timeDay2Day (model .monthlyByDayOfWeek );
630
+ eventRecurrence .bydayNum [0 ] = model .monthlyByNthDayOfWeek ;
631
631
}
632
632
break ;
633
633
case RecurrenceModel .FREQ_WEEKLY :
@@ -638,24 +638,24 @@ static private void copyModelToEventRecurrence(final RecurrenceModel model, Even
638
638
}
639
639
}
640
640
641
- if (er .bydayCount < count || er .byday == null || er .bydayNum == null ) {
642
- er .byday = new int [count ];
643
- er .bydayNum = new int [count ];
641
+ if (eventRecurrence .bydayCount < count || eventRecurrence .byday == null || eventRecurrence .bydayNum == null ) {
642
+ eventRecurrence .byday = new int [count ];
643
+ eventRecurrence .bydayNum = new int [count ];
644
644
}
645
- er .bydayCount = count ;
645
+ eventRecurrence .bydayCount = count ;
646
646
647
647
for (int i = 6 ; i >= 0 ; i --) {
648
648
if (model .weeklyByDayOfWeek [i ]) {
649
- er .bydayNum [--count ] = 0 ;
650
- er .byday [count ] = EventRecurrence .timeDay2Day (i );
649
+ eventRecurrence .bydayNum [--count ] = 0 ;
650
+ eventRecurrence .byday [count ] = EventRecurrence .timeDay2Day (i );
651
651
}
652
652
}
653
653
break ;
654
654
}
655
655
656
- if (!canHandleRecurrenceRule (er )) {
656
+ if (!canHandleRecurrenceRule (eventRecurrence )) {
657
657
throw new IllegalStateException ("UI generated recurrence that it can't handle. ER:"
658
- + er .toString () + " Model: " + model .toString ());
658
+ + eventRecurrence .toString () + " Model: " + model .toString ());
659
659
}
660
660
}
661
661
0 commit comments