diff --git a/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java b/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java index 7b0ac98a3..dfc77ca96 100644 --- a/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java +++ b/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java @@ -366,7 +366,7 @@ static boolean test(String id, DateTimeZone tz) { return false; } - if (nextKey == null || (nextKey.length() < 3 && !"??".equals(nextKey))) { + if (nextKey == null || (nextKey.length() < 3 && !"??".equals(nextKey) && !"%z".equals(nextKey))) { System.out.println("*s* Error in " + tz.getID() + " " + new DateTime(millis, ISOChronology.getInstanceUTC()) @@ -501,7 +501,7 @@ public Map compile(File outputDir, File[] sources) throws } } - // store "back" links as aliases (where name is permanently mapped + // store "back" links as aliases (where name is permanently mapped) for (int pass = 0; pass < 2; pass++) { for (int i = 0; i < iBackLinks.size(); i += 2) { String id = iBackLinks.get(i); @@ -636,7 +636,13 @@ public void parseDataFile(BufferedReader in, boolean backward) throws IOExceptio // links in "backward" are deprecated names // links in other files should be kept // special case a few to try to repair terrible damage to tzdb - if (backward || alias.equals("US/Pacific-New") || alias.startsWith("Etc/") || alias.equals("GMT")) { + if (alias.equals("WET") || alias.equals("CET") || alias.equals("EET")) { + iGoodLinks.add(real); + iGoodLinks.add(alias); + } else if (alias.equals("MET")) { + iBackLinks.add("CET"); // map MET -> CET (not Europe/Brussels) + iBackLinks.add(alias); + } else if (backward || alias.equals("US/Pacific-New") || alias.startsWith("Etc/") || alias.equals("GMT")) { iBackLinks.add(real); iBackLinks.add(alias); } else { @@ -948,7 +954,9 @@ public void addRecurring(DateTimeZoneBuilder builder, int standardMillis, String // if negative SAVE values, then patch standard millis and name format if (negativeSave < 0) { - System.out.println("Fixed negative save values for rule '" + iRules.get(0).iName + "'"); + if (ZoneInfoLogger.verbose()) { + System.out.println("Fixed negative save values for rule '" + iRules.get(0).iName + "'"); + } standardMillis += negativeSave; int slashPos = nameFormat.indexOf("/"); if (slashPos > 0) { diff --git a/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java b/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java index 102760d62..46128e6e2 100644 --- a/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java +++ b/src/test/java/org/joda/time/format/TestDateTimeFormatterBuilder.java @@ -21,15 +21,15 @@ import java.util.Locale; import java.util.Map; -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; -import junit.framework.TestSuite; - import org.joda.time.DateTime; import org.joda.time.DateTimeFieldType; import org.joda.time.DateTimeZone; import org.joda.time.LocalDateTime; +import junit.framework.AssertionFailedError; +import junit.framework.TestCase; +import junit.framework.TestSuite; + /** * This class is a Junit unit test for DateTimeFormatterBuilder. * @@ -553,8 +553,8 @@ public void test_printParseZoneMET() { DateTimeFormatter f = bld.toFormatter(); DateTime dt = new DateTime(2007, 3, 4, 12, 30, 0, DateTimeZone.forID("MET")); - assertEquals("2007-03-04 12:30 MET", f.print(dt)); - assertEquals(dt, f.parseDateTime("2007-03-04 12:30 MET")); + assertEquals("2007-03-04 12:30 CET", f.print(dt)); + assertEquals(dt, f.parseDateTime("2007-03-04 12:30 CET")); } public void test_printParseZoneMET_suffix() { @@ -563,8 +563,8 @@ public void test_printParseZoneMET_suffix() { DateTimeFormatter f = bld.toFormatter(); DateTime dt = new DateTime(2007, 3, 4, 12, 30, 0, DateTimeZone.forID("MET")); - assertEquals("2007-03-04 12:30 MET]", f.print(dt)); - assertEquals(dt, f.parseDateTime("2007-03-04 12:30 MET]")); + assertEquals("2007-03-04 12:30 CET]", f.print(dt)); + assertEquals(dt, f.parseDateTime("2007-03-04 12:30 CET]")); } public void test_printParseZoneBahiaBanderas() {