changeset 10346:189490f29d1e

8051641: Africa/Casablanca transitions is incorrectly calculated starting from 2027 Reviewed-by: sherman
author aefimov
date Mon, 29 Dec 2014 21:42:22 +0300
parents c8a71253d6e2
children c8b4e66ab998
files make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java test/ProblemList.txt test/sun/util/calendar/zi/Rule.java
diffstat 3 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java	Thu Oct 23 11:42:20 2014 +0200
+++ b/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java	Mon Dec 29 21:42:22 2014 +0300
@@ -491,10 +491,10 @@
                 TZRule rule = new TZRule(year, month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition, savingAmountSecs);
                 if (lastRule) {
                     lastRuleList.add(rule);
-                    maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
                 } else {
                     ruleList.add(rule);
                 }
+                maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
                 year++;
             }
         }
--- a/test/ProblemList.txt	Thu Oct 23 11:42:20 2014 +0200
+++ b/test/ProblemList.txt	Mon Dec 29 21:42:22 2014 +0300
@@ -272,7 +272,4 @@
 # Filed 6772009
 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
 
-# 8051641
-sun/util/calendar/zi/TestZoneInfo310.java                        generic-all
-
 ############################################################################
--- a/test/sun/util/calendar/zi/Rule.java	Thu Oct 23 11:42:20 2014 +0200
+++ b/test/sun/util/calendar/zi/Rule.java	Mon Dec 29 21:42:22 2014 +0300
@@ -126,6 +126,14 @@
             });
         rules.clear();
         for (int i = 0; i < n; i++) {
+            if (i != 0 && recs[i -1].getSave() == recs[i].getSave()) {
+                // we have two recs back to back with same saving for the same year.
+                if (recs[i].isLastRule()) {
+                    continue;
+                } else if (recs[i - 1].isLastRule()) {
+                    rules.remove(rules.size() - 1);
+                }
+            }
             rules.add(recs[i]);
         }
         return rules;