From e0b01d44d113a7a1504f48f0ae924a57a01d90a2 Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Mon, 7 Dec 2015 23:18:43 +0000 Subject: [PATCH] Remove tabs --- .../org/joda/time/tz/ZoneInfoCompiler.java | 6 ++-- .../java/org/joda/time/tz/TestCompiler.java | 33 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java b/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java index e3c509e55..a04f2782b 100644 --- a/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java +++ b/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java @@ -528,9 +528,9 @@ public void parseDataFile(BufferedReader in, boolean backward) throws IOExceptio rs.addRule(r); } } else if (token.equalsIgnoreCase("Zone")) { - if (st.countTokens() < 4) { - throw new IllegalArgumentException("Attempting to create a Zone from an incomplete tokenizer"); - } + if (st.countTokens() < 4) { + throw new IllegalArgumentException("Attempting to create a Zone from an incomplete tokenizer"); + } zone = new Zone(st); } else if (token.equalsIgnoreCase("Link")) { String real = st.nextToken(); diff --git a/src/test/java/org/joda/time/tz/TestCompiler.java b/src/test/java/org/joda/time/tz/TestCompiler.java index ac7936383..7cf6b9949 100644 --- a/src/test/java/org/joda/time/tz/TestCompiler.java +++ b/src/test/java/org/joda/time/tz/TestCompiler.java @@ -70,19 +70,19 @@ public static TestSuite suite() { " -8:00 CA P%sT 1967\n" + " -8:00 US P%sT"; - static final String BROKEN_TIMEZONE_FILE = + static final String BROKEN_TIMEZONE_FILE = "# Incomplete Rules for building America/Los_Angeles time zone.\n" + "\n" + "Rule US 1918 1919 - Mar lastSun 2:00 1:00 D\n" + "Rule \n" ; // this line is intentionally incomplete static final String BROKEN_TIMEZONE_FILE_2 = - "# Incomplete Zone for building America/Los_Angeles time zone.\n" + - "\n" + - "Rule CA 1948 only - Mar 14 2:00 1:00 D\n" + - "Rule CA 1949 only - Jan 1 2:00 0 S\n" + - "\n" + - "Zone "; // this line is intentionally left incomplete + "# Incomplete Zone for building America/Los_Angeles time zone.\n" + + "\n" + + "Rule CA 1948 only - Mar 14 2:00 1:00 D\n" + + "Rule CA 1949 only - Jan 1 2:00 0 S\n" + + "\n" + + "Zone "; // this line is intentionally left incomplete private DateTimeZone originalDateTimeZone = null; @@ -144,16 +144,17 @@ public void testCompileOnBrokenTimeZoneFile() throws Exception { assertEquals("Attempting to create a Rule from an incomplete tokenizer", iae.getMessage()); } } + public void testCompileOnBrokenTimeZoneFile_2() throws Exception { - try { - Provider provider = compileAndLoad(BROKEN_TIMEZONE_FILE_2); - fail(); - } catch(NoSuchElementException nsee) { - // This thrown from the Zone constructor - fail("NoSuchElementException was thrown; broken timezone file?"); - } catch(IllegalArgumentException iae) { - assertEquals("Attempting to create a Zone from an incomplete tokenizer", iae.getMessage()); - } + try { + Provider provider = compileAndLoad(BROKEN_TIMEZONE_FILE_2); + fail(); + } catch (NoSuchElementException nsee) { + // This thrown from the Zone constructor + fail("NoSuchElementException was thrown; broken timezone file?"); + } catch (IllegalArgumentException iae) { + assertEquals("Attempting to create a Zone from an incomplete tokenizer", iae.getMessage()); + } } private Provider compileAndLoad(String data) throws Exception {