DateTimeZone.java 23.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862
package org.joda.time;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import org.joda.convert.FromString;
import org.joda.convert.ToString;
import org.joda.time.chrono.BaseChronology;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.DateTimeFormatterBuilder;
import org.joda.time.format.FormatUtils;
import org.joda.time.tz.DefaultNameProvider;
import org.joda.time.tz.FixedDateTimeZone;
import org.joda.time.tz.NameProvider;
import org.joda.time.tz.Provider;
import org.joda.time.tz.UTCProvider;
import org.joda.time.tz.ZoneInfoProvider;

public abstract class DateTimeZone
  implements Serializable
{
  public static final DateTimeZone UTC = new FixedDateTimeZone("UTC", "UTC", 0, 0);
  private static Provider a;
  private static NameProvider b;
  private static Set<String> c;
  private static volatile DateTimeZone d;
  private static DateTimeFormatter e;
  private static Map<String, SoftReference<DateTimeZone>> f;
  private static Map<String, String> g;
  private static final long serialVersionUID = 5546345482340108586L;
  private final String h;
  
  static
  {
    a(null);
    a(null);
  }
  
  protected DateTimeZone(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("Id must not be null");
    }
    this.h = paramString;
  }
  
  private static String a(int paramInt)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    if (paramInt >= 0) {
      localStringBuffer.append('+');
    }
    for (;;)
    {
      i = paramInt / 3600000;
      FormatUtils.appendPaddedInteger(localStringBuffer, i, 2);
      paramInt -= i * 3600000;
      i = paramInt / 60000;
      localStringBuffer.append(':');
      FormatUtils.appendPaddedInteger(localStringBuffer, i, 2);
      paramInt -= i * 60000;
      if (paramInt != 0) {
        break;
      }
      return localStringBuffer.toString();
      localStringBuffer.append('-');
      paramInt = -paramInt;
    }
    int i = paramInt / 1000;
    localStringBuffer.append(':');
    FormatUtils.appendPaddedInteger(localStringBuffer, i, 2);
    paramInt -= i * 1000;
    if (paramInt == 0) {
      return localStringBuffer.toString();
    }
    localStringBuffer.append('.');
    FormatUtils.appendPaddedInteger(localStringBuffer, paramInt, 3);
    return localStringBuffer.toString();
  }
  
  private static String a(String paramString)
  {
    try
    {
      Map localMap = g;
      Object localObject = localMap;
      if (localMap == null)
      {
        localObject = new HashMap();
        ((Map)localObject).put("GMT", "UTC");
        ((Map)localObject).put("WET", "WET");
        ((Map)localObject).put("CET", "CET");
        ((Map)localObject).put("MET", "CET");
        ((Map)localObject).put("ECT", "CET");
        ((Map)localObject).put("EET", "EET");
        ((Map)localObject).put("MIT", "Pacific/Apia");
        ((Map)localObject).put("HST", "Pacific/Honolulu");
        ((Map)localObject).put("AST", "America/Anchorage");
        ((Map)localObject).put("PST", "America/Los_Angeles");
        ((Map)localObject).put("MST", "America/Denver");
        ((Map)localObject).put("PNT", "America/Phoenix");
        ((Map)localObject).put("CST", "America/Chicago");
        ((Map)localObject).put("EST", "America/New_York");
        ((Map)localObject).put("IET", "America/Indiana/Indianapolis");
        ((Map)localObject).put("PRT", "America/Puerto_Rico");
        ((Map)localObject).put("CNT", "America/St_Johns");
        ((Map)localObject).put("AGT", "America/Argentina/Buenos_Aires");
        ((Map)localObject).put("BET", "America/Sao_Paulo");
        ((Map)localObject).put("ART", "Africa/Cairo");
        ((Map)localObject).put("CAT", "Africa/Harare");
        ((Map)localObject).put("EAT", "Africa/Addis_Ababa");
        ((Map)localObject).put("NET", "Asia/Yerevan");
        ((Map)localObject).put("PLT", "Asia/Karachi");
        ((Map)localObject).put("IST", "Asia/Kolkata");
        ((Map)localObject).put("BST", "Asia/Dhaka");
        ((Map)localObject).put("VST", "Asia/Ho_Chi_Minh");
        ((Map)localObject).put("CTT", "Asia/Shanghai");
        ((Map)localObject).put("JST", "Asia/Tokyo");
        ((Map)localObject).put("ACT", "Australia/Darwin");
        ((Map)localObject).put("AET", "Australia/Sydney");
        ((Map)localObject).put("SST", "Pacific/Guadalcanal");
        ((Map)localObject).put("NST", "Pacific/Auckland");
        g = (Map)localObject;
      }
      paramString = (String)((Map)localObject).get(paramString);
      return paramString;
    }
    finally {}
  }
  
  private static DateTimeZone a(String paramString, int paramInt)
  {
    if (paramInt == 0) {}
    for (;;)
    {
      try
      {
        localObject = UTC;
        return (DateTimeZone)localObject;
      }
      finally {}
      if (f == null) {
        f = new HashMap();
      }
      Object localObject = (Reference)f.get(paramString);
      if (localObject != null)
      {
        DateTimeZone localDateTimeZone = (DateTimeZone)((Reference)localObject).get();
        localObject = localDateTimeZone;
        if (localDateTimeZone != null) {}
      }
      else
      {
        localObject = new FixedDateTimeZone(paramString, null, paramInt, paramInt);
        f.put(paramString, new SoftReference(localObject));
      }
    }
  }
  
  private static Provider a()
  {
    localObject4 = null;
    for (;;)
    {
      try
      {
        localObject5 = System.getProperty("org.joda.time.DateTimeZone.Provider");
        localObject1 = localObject4;
        if (localObject5 == null) {}
      }
      catch (SecurityException localSecurityException)
      {
        Object localObject5;
        Object localObject1;
        Object localObject2;
        Object localObject3 = localObject4;
        continue;
        continue;
      }
      try
      {
        localObject1 = (Provider)Class.forName((String)localObject5).newInstance();
        if (localObject1 != null) {}
      }
      catch (Exception localException1)
      {
        try
        {
          localObject4 = new ZoneInfoProvider("org/joda/time/tz/data");
          localObject1 = localObject4;
          localObject4 = localObject1;
          if (localObject1 == null) {
            localObject4 = new UTCProvider();
          }
          return (Provider)localObject4;
        }
        catch (Exception localException2)
        {
          localObject5 = Thread.currentThread();
          ((Thread)localObject5).getThreadGroup().uncaughtException((Thread)localObject5, localException2);
        }
        localException1 = localException1;
        localObject5 = Thread.currentThread();
        ((Thread)localObject5).getThreadGroup().uncaughtException((Thread)localObject5, localException1);
        localObject2 = localObject4;
      }
    }
  }
  
  private static void a(NameProvider paramNameProvider)
  {
    NameProvider localNameProvider = paramNameProvider;
    if (paramNameProvider == null) {
      localNameProvider = b();
    }
    b = localNameProvider;
  }
  
  private static void a(Provider paramProvider)
  {
    Provider localProvider = paramProvider;
    if (paramProvider == null) {
      localProvider = a();
    }
    paramProvider = localProvider.getAvailableIDs();
    if ((paramProvider == null) || (paramProvider.size() == 0)) {
      throw new IllegalArgumentException("The provider doesn't have any available ids");
    }
    if (!paramProvider.contains("UTC")) {
      throw new IllegalArgumentException("The provider doesn't support UTC");
    }
    if (!UTC.equals(localProvider.getZone("UTC"))) {
      throw new IllegalArgumentException("Invalid UTC zone provided");
    }
    a = localProvider;
    c = paramProvider;
  }
  
  private static int b(String paramString)
  {
    BaseChronology local1 = new BaseChronology()
    {
      public final DateTimeZone getZone()
      {
        return null;
      }
      
      public final String toString()
      {
        return getClass().getName();
      }
      
      public final Chronology withUTC()
      {
        return this;
      }
      
      public final Chronology withZone(DateTimeZone paramAnonymousDateTimeZone)
      {
        return this;
      }
    };
    return -(int)c().withChronology(local1).parseMillis(paramString);
  }
  
  private static NameProvider b()
  {
    for (;;)
    {
      try
      {
        localObject1 = System.getProperty("org.joda.time.DateTimeZone.NameProvider");
        if (localObject1 == null) {
          continue;
        }
      }
      catch (SecurityException localSecurityException)
      {
        Object localObject1;
        Object localObject4;
        Object localObject2;
        Object localObject3 = null;
        continue;
      }
      try
      {
        localObject1 = (NameProvider)Class.forName((String)localObject1).newInstance();
        localObject4 = localObject1;
        if (localObject1 == null) {
          localObject4 = new DefaultNameProvider();
        }
        return (NameProvider)localObject4;
      }
      catch (Exception localException)
      {
        localObject4 = Thread.currentThread();
        ((Thread)localObject4).getThreadGroup().uncaughtException((Thread)localObject4, localException);
      }
      localObject2 = null;
    }
  }
  
  private static DateTimeFormatter c()
  {
    try
    {
      if (e == null) {
        e = new DateTimeFormatterBuilder().appendTimeZoneOffset(null, true, 2, 4).toFormatter();
      }
      DateTimeFormatter localDateTimeFormatter = e;
      return localDateTimeFormatter;
    }
    finally {}
  }
  
  @FromString
  public static DateTimeZone forID(String paramString)
  {
    Object localObject;
    if (paramString == null) {
      localObject = getDefault();
    }
    DateTimeZone localDateTimeZone;
    do
    {
      return (DateTimeZone)localObject;
      if (paramString.equals("UTC")) {
        return UTC;
      }
      localDateTimeZone = a.getZone(paramString);
      localObject = localDateTimeZone;
    } while (localDateTimeZone != null);
    if ((paramString.startsWith("+")) || (paramString.startsWith("-")))
    {
      int i = b(paramString);
      if (i == 0L) {
        return UTC;
      }
      return a(a(i), i);
    }
    throw new IllegalArgumentException("The datetime zone id '" + paramString + "' is not recognised");
  }
  
  public static DateTimeZone forOffsetHours(int paramInt)
    throws IllegalArgumentException
  {
    return forOffsetHoursMinutes(paramInt, 0);
  }
  
  /* Error */
  public static DateTimeZone forOffsetHoursMinutes(int paramInt1, int paramInt2)
    throws IllegalArgumentException
  {
    // Byte code:
    //   0: iload_0
    //   1: ifne +11 -> 12
    //   4: iload_1
    //   5: ifne +7 -> 12
    //   8: getstatic 44	org/joda/time/DateTimeZone:UTC	Lorg/joda/time/DateTimeZone;
    //   11: areturn
    //   12: iload_1
    //   13: iflt +9 -> 22
    //   16: iload_1
    //   17: bipush 59
    //   19: if_icmple +28 -> 47
    //   22: new 56	java/lang/IllegalArgumentException
    //   25: dup
    //   26: new 375	java/lang/StringBuilder
    //   29: dup
    //   30: ldc_w 396
    //   33: invokespecial 378	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   36: iload_1
    //   37: invokevirtual 399	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   40: invokevirtual 384	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   43: invokespecial 60	java/lang/IllegalArgumentException:<init>	(Ljava/lang/String;)V
    //   46: athrow
    //   47: iload_0
    //   48: bipush 60
    //   50: invokestatic 405	org/joda/time/field/FieldUtils:safeMultiply	(II)I
    //   53: istore_0
    //   54: iload_0
    //   55: ifge +22 -> 77
    //   58: iload_0
    //   59: iload_1
    //   60: ineg
    //   61: invokestatic 408	org/joda/time/field/FieldUtils:safeAdd	(II)I
    //   64: istore_0
    //   65: iload_0
    //   66: ldc 78
    //   68: invokestatic 405	org/joda/time/field/FieldUtils:safeMultiply	(II)I
    //   71: istore_0
    //   72: iload_0
    //   73: invokestatic 411	org/joda/time/DateTimeZone:forOffsetMillis	(I)Lorg/joda/time/DateTimeZone;
    //   76: areturn
    //   77: iload_0
    //   78: iload_1
    //   79: invokestatic 408	org/joda/time/field/FieldUtils:safeAdd	(II)I
    //   82: istore_0
    //   83: goto -18 -> 65
    //   86: astore_2
    //   87: new 56	java/lang/IllegalArgumentException
    //   90: dup
    //   91: ldc_w 413
    //   94: invokespecial 60	java/lang/IllegalArgumentException:<init>	(Ljava/lang/String;)V
    //   97: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	98	0	paramInt1	int
    //   0	98	1	paramInt2	int
    //   86	1	2	localArithmeticException	ArithmeticException
    // Exception table:
    //   from	to	target	type
    //   47	54	86	java/lang/ArithmeticException
    //   58	65	86	java/lang/ArithmeticException
    //   65	72	86	java/lang/ArithmeticException
    //   77	83	86	java/lang/ArithmeticException
  }
  
  public static DateTimeZone forOffsetMillis(int paramInt)
  {
    return a(a(paramInt), paramInt);
  }
  
  public static DateTimeZone forTimeZone(TimeZone paramTimeZone)
  {
    Object localObject2;
    if (paramTimeZone == null) {
      localObject2 = getDefault();
    }
    String str1;
    String str2;
    Object localObject1;
    do
    {
      return (DateTimeZone)localObject2;
      str1 = paramTimeZone.getID();
      if (str1.equals("UTC")) {
        return UTC;
      }
      localObject2 = null;
      str2 = a(str1);
      if (str2 != null) {
        localObject2 = a.getZone(str2);
      }
      localObject1 = localObject2;
      if (localObject2 == null) {
        localObject1 = a.getZone(str1);
      }
      localObject2 = localObject1;
    } while (localObject1 != null);
    if (str2 == null)
    {
      paramTimeZone = paramTimeZone.getID();
      if ((paramTimeZone.startsWith("GMT+")) || (paramTimeZone.startsWith("GMT-")))
      {
        int i = b(paramTimeZone.substring(3));
        if (i == 0L) {
          return UTC;
        }
        return a(a(i), i);
      }
    }
    throw new IllegalArgumentException("The datetime zone id '" + str1 + "' is not recognised");
  }
  
  public static Set<String> getAvailableIDs()
  {
    return c;
  }
  
  public static DateTimeZone getDefault()
  {
    Object localObject1 = d;
    if (localObject1 == null)
    {
      for (;;)
      {
        Object localObject4;
        DateTimeZone localDateTimeZone;
        String str;
        try
        {
          localObject4 = d;
          localObject1 = localObject4;
          if (localObject4 == null)
          {
            localDateTimeZone = null;
            localObject4 = null;
            localObject1 = localDateTimeZone;
          }
        }
        finally {}
        try
        {
          str = System.getProperty("user.timezone");
          localObject1 = localObject4;
          if (str != null)
          {
            localObject1 = localDateTimeZone;
            localDateTimeZone = forID(str);
            localObject1 = localDateTimeZone;
          }
        }
        catch (IllegalArgumentException localIllegalArgumentException)
        {
          localObject5 = localObject2;
        }
        catch (RuntimeException localRuntimeException)
        {
          Object localObject5;
          localObject3 = localObject5;
        }
      }
      localObject4 = localObject1;
      if (localObject1 == null) {
        localObject4 = forTimeZone(TimeZone.getDefault());
      }
      localObject1 = localObject4;
      if (localObject4 == null) {
        localObject1 = UTC;
      }
      d = (DateTimeZone)localObject1;
      return (DateTimeZone)localObject1;
    }
    Object localObject3;
    return (DateTimeZone)localObject3;
  }
  
  public static NameProvider getNameProvider()
  {
    return b;
  }
  
  public static Provider getProvider()
  {
    return a;
  }
  
  public static void setDefault(DateTimeZone paramDateTimeZone)
    throws SecurityException
  {
    SecurityManager localSecurityManager = System.getSecurityManager();
    if (localSecurityManager != null) {
      localSecurityManager.checkPermission(new JodaTimePermission("DateTimeZone.setDefault"));
    }
    if (paramDateTimeZone == null) {
      throw new IllegalArgumentException("The datetime zone must not be null");
    }
    try
    {
      d = paramDateTimeZone;
      return;
    }
    finally {}
  }
  
  public static void setNameProvider(NameProvider paramNameProvider)
    throws SecurityException
  {
    SecurityManager localSecurityManager = System.getSecurityManager();
    if (localSecurityManager != null) {
      localSecurityManager.checkPermission(new JodaTimePermission("DateTimeZone.setNameProvider"));
    }
    a(paramNameProvider);
  }
  
  public static void setProvider(Provider paramProvider)
    throws SecurityException
  {
    SecurityManager localSecurityManager = System.getSecurityManager();
    if (localSecurityManager != null) {
      localSecurityManager.checkPermission(new JodaTimePermission("DateTimeZone.setProvider"));
    }
    a(paramProvider);
  }
  
  public long adjustOffset(long paramLong, boolean paramBoolean)
  {
    long l1 = paramLong - 10800000L;
    long l2 = getOffset(l1);
    long l3 = getOffset(10800000L + paramLong);
    if (l2 <= l3) {}
    do
    {
      do
      {
        do
        {
          return paramLong;
          l2 -= l3;
          l1 = nextTransition(l1);
          l3 = l1 - l2;
        } while ((paramLong < l3) || (paramLong >= l1 + l2));
        if (paramLong - l3 < l2) {
          break;
        }
      } while (paramBoolean);
      return paramLong - l2;
    } while (!paramBoolean);
    return paramLong + l2;
  }
  
  public long convertLocalToUTC(long paramLong, boolean paramBoolean)
  {
    long l2 = Long.MAX_VALUE;
    int i = getOffset(paramLong);
    int j = getOffset(paramLong - i);
    long l3;
    long l1;
    if ((i != j) && ((paramBoolean) || (i < 0)))
    {
      l3 = nextTransition(paramLong - i);
      l1 = l3;
      if (l3 == paramLong - i) {
        l1 = Long.MAX_VALUE;
      }
      l3 = nextTransition(paramLong - j);
      if (l3 != paramLong - j) {
        break label164;
      }
    }
    for (;;)
    {
      if (l1 != l2) {
        if (paramBoolean) {
          throw new IllegalInstantException(paramLong, getID());
        }
      }
      for (;;)
      {
        l1 = paramLong - i;
        if (((paramLong ^ l1) < 0L) && ((i ^ paramLong) < 0L)) {
          throw new ArithmeticException("Subtracting time zone offset caused overflow");
        }
        return l1;
        i = j;
      }
      label164:
      l2 = l3;
    }
  }
  
  public long convertLocalToUTC(long paramLong1, boolean paramBoolean, long paramLong2)
  {
    int i = getOffset(paramLong2);
    paramLong2 = paramLong1 - i;
    if (getOffset(paramLong2) == i) {
      return paramLong2;
    }
    return convertLocalToUTC(paramLong1, paramBoolean);
  }
  
  public long convertUTCToLocal(long paramLong)
  {
    int i = getOffset(paramLong);
    long l = i + paramLong;
    if (((paramLong ^ l) < 0L) && ((i ^ paramLong) >= 0L)) {
      throw new ArithmeticException("Adding time zone offset caused overflow");
    }
    return l;
  }
  
  public abstract boolean equals(Object paramObject);
  
  @ToString
  public final String getID()
  {
    return this.h;
  }
  
  public long getMillisKeepLocal(DateTimeZone paramDateTimeZone, long paramLong)
  {
    if (paramDateTimeZone == null) {
      paramDateTimeZone = getDefault();
    }
    for (;;)
    {
      if (paramDateTimeZone == this) {
        return paramLong;
      }
      return paramDateTimeZone.convertLocalToUTC(convertUTCToLocal(paramLong), false, paramLong);
    }
  }
  
  public final String getName(long paramLong)
  {
    return getName(paramLong, null);
  }
  
  public String getName(long paramLong, Locale paramLocale)
  {
    Object localObject = paramLocale;
    if (paramLocale == null) {
      localObject = Locale.getDefault();
    }
    paramLocale = getNameKey(paramLong);
    if (paramLocale == null) {
      paramLocale = this.h;
    }
    do
    {
      return paramLocale;
      localObject = b.getName((Locale)localObject, this.h, paramLocale);
      paramLocale = (Locale)localObject;
    } while (localObject != null);
    return a(getOffset(paramLong));
  }
  
  public abstract String getNameKey(long paramLong);
  
  public abstract int getOffset(long paramLong);
  
  public final int getOffset(ReadableInstant paramReadableInstant)
  {
    if (paramReadableInstant == null) {
      return getOffset(DateTimeUtils.currentTimeMillis());
    }
    return getOffset(paramReadableInstant.getMillis());
  }
  
  public int getOffsetFromLocal(long paramLong)
  {
    int i = getOffset(paramLong);
    long l = paramLong - i;
    int j = getOffset(l);
    if (i != j)
    {
      if ((i - j < 0) && (nextTransition(l) != nextTransition(paramLong - j))) {
        return i;
      }
    }
    else if (i >= 0)
    {
      paramLong = previousTransition(l);
      if (paramLong < l)
      {
        int k = getOffset(paramLong);
        if (l - paramLong <= k - i) {
          return k;
        }
      }
    }
    return j;
  }
  
  public final String getShortName(long paramLong)
  {
    return getShortName(paramLong, null);
  }
  
  public String getShortName(long paramLong, Locale paramLocale)
  {
    Object localObject = paramLocale;
    if (paramLocale == null) {
      localObject = Locale.getDefault();
    }
    paramLocale = getNameKey(paramLong);
    if (paramLocale == null) {
      paramLocale = this.h;
    }
    do
    {
      return paramLocale;
      localObject = b.getShortName((Locale)localObject, this.h, paramLocale);
      paramLocale = (Locale)localObject;
    } while (localObject != null);
    return a(getOffset(paramLong));
  }
  
  public abstract int getStandardOffset(long paramLong);
  
  public int hashCode()
  {
    return getID().hashCode() + 57;
  }
  
  public abstract boolean isFixed();
  
  public boolean isLocalDateTimeGap(LocalDateTime paramLocalDateTime)
  {
    if (isFixed()) {
      return false;
    }
    try
    {
      paramLocalDateTime.toDateTime(this);
      return false;
    }
    catch (IllegalInstantException paramLocalDateTime) {}
    return true;
  }
  
  public boolean isStandardOffset(long paramLong)
  {
    return getOffset(paramLong) == getStandardOffset(paramLong);
  }
  
  public abstract long nextTransition(long paramLong);
  
  public abstract long previousTransition(long paramLong);
  
  public String toString()
  {
    return getID();
  }
  
  public TimeZone toTimeZone()
  {
    return TimeZone.getTimeZone(this.h);
  }
  
  protected Object writeReplace()
    throws ObjectStreamException
  {
    return new a(this.h);
  }
  
  static final class a
    implements Serializable
  {
    private static final long serialVersionUID = -6471952376487863581L;
    private transient String a;
    
    a(String paramString)
    {
      this.a = paramString;
    }
    
    private void readObject(ObjectInputStream paramObjectInputStream)
      throws IOException
    {
      this.a = paramObjectInputStream.readUTF();
    }
    
    private Object readResolve()
      throws ObjectStreamException
    {
      return DateTimeZone.forID(this.a);
    }
    
    private void writeObject(ObjectOutputStream paramObjectOutputStream)
      throws IOException
    {
      paramObjectOutputStream.writeUTF(this.a);
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/DateTimeZone.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */