]> granicus.if.org Git - icu/commitdiff
ICU-11572 API proposal updates for approved constants
authorScott Russell <DTownSMR@gmail.com>
Wed, 16 Sep 2015 02:36:11 +0000 (02:36 +0000)
committerScott Russell <DTownSMR@gmail.com>
Wed, 16 Sep 2015 02:36:11 +0000 (02:36 +0000)
X-SVN-Rev: 37962

icu4j/main/classes/core/src/com/ibm/icu/text/DateFormat.java
icu4j/main/classes/core/src/com/ibm/icu/text/SimpleDateFormat.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatRegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatTest.java

index 88432bcc2d8753d186cdfc1f04f551ee6eeb359b..de45b85f9032469cdca22c4b1c3f231f90bea073 100644 (file)
@@ -491,16 +491,17 @@ public abstract class DateFormat extends UFormat {
         /** 
          * indicates tolerance of pattern mismatch between input data and specified format pattern.
          * e.g. accepting "September" for a month pattern of MMM ("Sep")  
-         * @draft ICU 53
+         * @draft ICU 56
          * @provisional This API might change or be removed in a future release.
          */
         PARSE_MULTIPLE_PATTERNS_FOR_MATCH, 
         /**
          * indicates tolerance of a partial literal match
-         * @draft ICU 53
+         * e.g. accepting "--mon-02-march-2011" for a pattern of "'--: 'EEE-WW-MMMM-yyyy"
+         * @draft ICU 56
          * @provisional This API might change or be removed in a future release.
          */
-        PARSE_PARTIAL_MATCH
+        PARSE_PARTIAL_LITERAL_MATCH
     };
     
     /**
index 459b11ee1c7b1eae2d702711fddf715386ec6c83..e42b59dd21460ed9030c627c77a01df4f34205a6 100644 (file)
@@ -2572,7 +2572,7 @@ public class SimpleDateFormat extends DateFormat {
                 } else if ((pch == ' ' || pch == '.') && getBooleanAttribute(DateFormat.BooleanAttribute.PARSE_ALLOW_WHITESPACE)) {
                     ++idx;
                     continue;
-                } else if (pos != originalPos && getBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_MATCH)) {
+                } else if (pos != originalPos && getBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH)) {
                     ++idx;
                     continue;
                 }
@@ -3341,7 +3341,7 @@ public class SimpleDateFormat extends DateFormat {
                 }
 
                 // If lenient, add also the alternate, if different from the locale.
-                if (getBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_MATCH) &&
+                if (getBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH) &&
                         !formatData.getTimeSeparatorString().equals(DateFormatSymbols.ALTERNATE_TIME_SEPARATOR)) {
                     data.add(DateFormatSymbols.ALTERNATE_TIME_SEPARATOR);
                 }
index f11138837dd0c96a09cf7d677b8bf7d140906ae9..4a4669cd5d1ddb6cf825787fea3a1788874b9acb 100644 (file)
@@ -1282,7 +1282,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         String text = new String("--mon-02-march-2011");
         SimpleDateFormat format = new SimpleDateFormat(pattern);
 
-        format.setBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_MATCH, false);      
+        format.setBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH, false);      
         try {
             format.parse(text);
             errln("parse partial match did NOT fail in strict mode!");
@@ -1290,7 +1290,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             // expected
         }
 
-        format.setBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_MATCH, true);
+        format.setBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH, true);
         try {
             format.parse(text);
         } catch (ParseException pe) {
index 0a2c15341df54269d07d7904d1a87ebcc4cc39fd..a5b39490be291314e39b27853512d6451cf89b72 100644 (file)
@@ -4581,7 +4581,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
             SimpleDateFormat sdfmt = new SimpleDateFormat(item.pattern, item.locale);
             sdfmt.setBooleanAttribute(BooleanAttribute.PARSE_ALLOW_WHITESPACE, item.leniency)
                     .setBooleanAttribute(BooleanAttribute.PARSE_ALLOW_NUMERIC, item.leniency)
-                    .setBooleanAttribute(BooleanAttribute.PARSE_PARTIAL_MATCH, item.leniency);
+                    .setBooleanAttribute(BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH, item.leniency);
 
             ParsePosition p = new ParsePosition(0);
             Date d = sdfmt.parse(item.parseString, p);
@@ -4745,7 +4745,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         assertTrue("isCalendarLenient default", fmt.isCalendarLenient());
         assertTrue("ALLOW_WHITESPACE default", fmt.getBooleanAttribute(BooleanAttribute.PARSE_ALLOW_WHITESPACE));
         assertTrue("ALLOW_NUMERIC default", fmt.getBooleanAttribute(BooleanAttribute.PARSE_ALLOW_NUMERIC));
-        assertTrue("PARTIAL_MATCH default", fmt.getBooleanAttribute(BooleanAttribute.PARSE_PARTIAL_MATCH));
+        assertTrue("PARTIAL_MATCH default", fmt.getBooleanAttribute(BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH));
         assertTrue("MULTIPLE_PATTERNS default", fmt.getBooleanAttribute(BooleanAttribute.PARSE_MULTIPLE_PATTERNS_FOR_MATCH));
 
         // Set calendar to strict
@@ -4764,7 +4764,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         assertFalse("ALLOW_WHITESPACE after setLenient(FALSE)", fmt.getBooleanAttribute(BooleanAttribute.PARSE_ALLOW_WHITESPACE));
         assertFalse("ALLOW_NUMERIC  after setLenient(FALSE)", fmt.getBooleanAttribute(BooleanAttribute.PARSE_ALLOW_NUMERIC));
         // These two boolean attributes are NOT affected according to the API specification
-        assertTrue("PARTIAL_MATCH after setLenient(FALSE)", fmt.getBooleanAttribute(BooleanAttribute.PARSE_PARTIAL_MATCH));
+        assertTrue("PARTIAL_MATCH after setLenient(FALSE)", fmt.getBooleanAttribute(BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH));
         assertTrue("MULTIPLE_PATTERNS after setLenient(FALSE)", fmt.getBooleanAttribute(BooleanAttribute.PARSE_MULTIPLE_PATTERNS_FOR_MATCH));
 
         // Allow white space leniency