jdk/test/sun/util/calendar/zi/Rule.java
changeset 28094 d0383a8fa398
parent 23010 6dadb192ad81
--- a/jdk/test/sun/util/calendar/zi/Rule.java	Tue Dec 16 12:48:31 2014 -0800
+++ b/jdk/test/sun/util/calendar/zi/Rule.java	Tue Dec 16 23:59:57 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;