rt/emul/compact/src/main/java/java/text/SimpleDateFormat.java
changeset 1339 8cc04f85a683
parent 1334 588d5bf7a560
     1.1 --- a/rt/emul/compact/src/main/java/java/text/SimpleDateFormat.java	Thu Oct 03 15:40:35 2013 +0200
     1.2 +++ b/rt/emul/compact/src/main/java/java/text/SimpleDateFormat.java	Fri Oct 04 11:07:00 2013 +0200
     1.3 @@ -43,7 +43,6 @@
     1.4  import java.io.ObjectInputStream;
     1.5  import java.util.Calendar;
     1.6  import java.util.Date;
     1.7 -import java.util.GregorianCalendar;
     1.8  import java.util.Locale;
     1.9  import java.util.Map;
    1.10  import java.util.MissingResourceException;
    1.11 @@ -52,9 +51,6 @@
    1.12  import java.util.TimeZone;
    1.13  import java.util.concurrent.ConcurrentHashMap;
    1.14  import java.util.concurrent.ConcurrentMap;
    1.15 -import sun.util.calendar.CalendarUtils;
    1.16 -import sun.util.calendar.ZoneInfoFile;
    1.17 -import sun.util.resources.LocaleData;
    1.18  
    1.19  import static java.text.DateFormatSymbols.*;
    1.20  
    1.21 @@ -621,7 +617,7 @@
    1.22          /* try the cache first */
    1.23          String[] dateTimePatterns = cachedLocaleData.get(loc);
    1.24          if (dateTimePatterns == null) { /* cache miss */
    1.25 -            ResourceBundle r = LocaleData.getDateFormatData(loc);
    1.26 +            ResourceBundle r = null; // LocaleData.getDateFormatData(loc);
    1.27              if (!isGregorianCalendar()) {
    1.28                  try {
    1.29                      dateTimePatterns = r.getStringArray(getCalendarName() + ".DateTimePatterns");
    1.30 @@ -1196,7 +1192,7 @@
    1.31                      if (zoneIndex == -1) {
    1.32                          value = calendar.get(Calendar.ZONE_OFFSET) +
    1.33                              calendar.get(Calendar.DST_OFFSET);
    1.34 -                        buffer.append(ZoneInfoFile.toCustomID(value));
    1.35 +//                        buffer.append(ZoneInfoFile.toCustomID(value));
    1.36                      } else {
    1.37                          int index = (calendar.get(Calendar.DST_OFFSET) == 0) ? 1: 3;
    1.38                          if (count < 4) {
    1.39 @@ -1227,7 +1223,7 @@
    1.40              }
    1.41  
    1.42              int num = (value / 60) * 100 + (value % 60);
    1.43 -            CalendarUtils.sprintf0d(buffer, num, width);
    1.44 +//            CalendarUtils.sprintf0d(buffer, num, width);
    1.45              break;
    1.46  
    1.47          case PATTERN_ISO_ZONE:   // 'X'
    1.48 @@ -1247,7 +1243,7 @@
    1.49                  value = -value;
    1.50              }
    1.51  
    1.52 -            CalendarUtils.sprintf0d(buffer, value / 60, 2);
    1.53 +//            CalendarUtils.sprintf0d(buffer, value / 60, 2);
    1.54              if (count == 1) {
    1.55                  break;
    1.56              }
    1.57 @@ -1255,7 +1251,7 @@
    1.58              if (count == 3) {
    1.59                  buffer.append(':');
    1.60              }
    1.61 -            CalendarUtils.sprintf0d(buffer, value % 60, 2);
    1.62 +//            CalendarUtils.sprintf0d(buffer, value % 60, 2);
    1.63              break;
    1.64  
    1.65          default:
    1.66 @@ -2347,4 +2343,41 @@
    1.67          }
    1.68      }
    1.69  
    1.70 +    private static final class GregorianCalendar extends Calendar {
    1.71 +        @Override
    1.72 +        protected void computeTime() {
    1.73 +        }
    1.74 +
    1.75 +        @Override
    1.76 +        protected void computeFields() {
    1.77 +        }
    1.78 +
    1.79 +        @Override
    1.80 +        public void add(int field, int amount) {
    1.81 +        }
    1.82 +
    1.83 +        @Override
    1.84 +        public void roll(int field, boolean up) {
    1.85 +        }
    1.86 +
    1.87 +        @Override
    1.88 +        public int getMinimum(int field) {
    1.89 +            return 0;
    1.90 +        }
    1.91 +
    1.92 +        @Override
    1.93 +        public int getMaximum(int field) {
    1.94 +            return 0;
    1.95 +        }
    1.96 +
    1.97 +        @Override
    1.98 +        public int getGreatestMinimum(int field) {
    1.99 +            return 0;
   1.100 +        }
   1.101 +
   1.102 +        @Override
   1.103 +        public int getLeastMaximum(int field) {
   1.104 +            return 0;
   1.105 +        }
   1.106 +    }
   1.107  }