(udtpg);
- UnicodeString dtFormatString((UBool)(length<0), dateTimeFormat, length);
+ UnicodeString dtFormatString(length < 0, dateTimeFormat, length);
dtpg->setDateTimeFormat(style, dtFormatString, *pErrorCode);
}
@@ -255,7 +255,7 @@ udatpg_getDateTimeFormatForStyle(const UDateTimePatternGenerator *udtpg,
U_CAPI void U_EXPORT2
udatpg_setDecimal(UDateTimePatternGenerator *dtpg,
const char16_t *decimal, int32_t length) {
- UnicodeString decimalString((UBool)(length<0), decimal, length);
+ UnicodeString decimalString(length < 0, decimal, length);
((DateTimePatternGenerator *)dtpg)->setDecimal(decimalString);
}
@@ -294,8 +294,8 @@ udatpg_replaceFieldTypesWithOptions(UDateTimePatternGenerator *dtpg,
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
- UnicodeString patternString((UBool)(patternLength<0), pattern, patternLength);
- UnicodeString skeletonString((UBool)(skeletonLength<0), skeleton, skeletonLength);
+ UnicodeString patternString(patternLength < 0, pattern, patternLength);
+ UnicodeString skeletonString(skeletonLength < 0, skeleton, skeletonLength);
UnicodeString result=((DateTimePatternGenerator *)dtpg)->replaceFieldTypes(patternString, skeletonString, options, *pErrorCode);
return result.extract(dest, destCapacity, *pErrorCode);
}
@@ -318,7 +318,7 @@ U_CAPI const char16_t * U_EXPORT2
udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
const char16_t *skeleton, int32_t skeletonLength,
int32_t *pLength) {
- UnicodeString skeletonString((UBool)(skeletonLength<0), skeleton, skeletonLength);
+ UnicodeString skeletonString(skeletonLength < 0, skeleton, skeletonLength);
const UnicodeString &result=((const DateTimePatternGenerator *)dtpg)->getPatternForSkeleton(skeletonString);
if(pLength!=nullptr) {
*pLength=result.length();
diff --git a/icu4c/source/i18n/unicode/messageformat2.h b/icu4c/source/i18n/unicode/messageformat2.h
index d23ac8409d81..c5459f042f40 100644
--- a/icu4c/source/i18n/unicode/messageformat2.h
+++ b/icu4c/source/i18n/unicode/messageformat2.h
@@ -139,6 +139,31 @@ namespace message2 {
*/
const MFDataModel& getDataModel() const;
+ /**
+ * Used in conjunction with the
+ * MessageFormatter::Builder::setErrorHandlingBehavior() method.
+ *
+ * @internal ICU 76 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ typedef enum UMFErrorHandlingBehavior {
+ /**
+ * Suppress errors and return best-effort output.
+ *
+ * @internal ICU 76 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ U_MF_BEST_EFFORT = 0,
+ /**
+ * Signal all MessageFormat errors using the UErrorCode
+ * argument.
+ *
+ * @internal ICU 76 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ U_MF_STRICT
+ } UMFErrorHandlingBehavior;
+
/**
* The mutable Builder class allows each part of the MessageFormatter to be initialized
* separately; calling its `build()` method yields an immutable MessageFormatter.
@@ -166,7 +191,10 @@ namespace message2 {
Locale locale;
// Not owned
const MFFunctionRegistry* customMFFunctionRegistry;
+ // Error behavior; see comment in `MessageFormatter` class
+ bool signalErrors = false;
+ void clearState();
public:
/**
* Sets the locale to use for formatting.
@@ -218,6 +246,36 @@ namespace message2 {
* @deprecated This API is for technology preview only.
*/
Builder& setDataModel(MFDataModel&& dataModel);
+ /**
+ * Set the error handling behavior for this formatter.
+ *
+ * "Strict" error behavior means that that formatting methods
+ * will set their UErrorCode arguments to signal MessageFormat
+ * data model, resolution, and runtime errors. Syntax errors are
+ * always signaled.
+ *
+ * "Best effort" error behavior means that MessageFormat errors are
+ * suppressed: formatting methods will _not_ set their
+ * UErrorCode arguments to signal MessageFormat data model,
+ * resolution, or runtime errors. Best-effort output
+ * will be returned. Syntax errors are always signaled.
+ * This is the default behavior.
+ *
+ * @param type An enum with type UMFErrorHandlingBehavior;
+ * if type == `U_MF_STRICT`, then
+ * errors are handled strictly.
+ * If type == `U_MF_BEST_EFFORT`, then
+ * best-effort output is returned.
+ *
+ * The default is to suppress all MessageFormat errors
+ * and return best-effort output.
+ *
+ * @return A reference to the builder.
+ *
+ * @internal ICU 76 technology preview
+ * @deprecated This API is for technology preview only.
+ */
+ Builder& setErrorHandlingBehavior(UMFErrorHandlingBehavior type);
/**
* Constructs a new immutable MessageFormatter using the pattern or data model
* that was previously set, and the locale (if it was previously set)
@@ -378,8 +436,15 @@ namespace message2 {
// Must be a raw pointer to avoid including the internal header file
// defining StaticErrors
// Owned by `this`
- StaticErrors* errors;
-
+ StaticErrors* errors = nullptr;
+
+ // Error handling behavior.
+ // If true, then formatting methods set their UErrorCode arguments
+ // to signal MessageFormat errors, and no useful output is returned.
+ // If false, then MessageFormat errors are not signaled and the
+ // formatting methods return best-effort output.
+ // The default is false.
+ bool signalErrors = false;
}; // class MessageFormatter
} // namespace message2
diff --git a/icu4c/source/i18n/unicode/reldatefmt.h b/icu4c/source/i18n/unicode/reldatefmt.h
index 5dc4905b12a8..25d5dffa105a 100644
--- a/icu4c/source/i18n/unicode/reldatefmt.h
+++ b/icu4c/source/i18n/unicode/reldatefmt.h
@@ -384,8 +384,10 @@ class U_I18N_API FormattedRelativeDateTime : public UMemory, public FormattedVal
*
*
*
- * In the future, we may add more forms, such as abbreviated/short forms
- * (3 secs ago), and relative day periods ("yesterday afternoon"), etc.
+ * The UDateRelativeDateTimeFormatterStyle parameter allows selection of
+ * different length styles: LONG ("3 seconds ago"), SHORT ("3 sec. ago"),
+ * NARROW ("3s ago"). In the future, we may add more forms, such as
+ * relative day periods ("yesterday afternoon"), etc.
*
* The RelativeDateTimeFormatter class is not intended for public subclassing.
*
diff --git a/icu4c/source/i18n/unicode/tblcoll.h b/icu4c/source/i18n/unicode/tblcoll.h
index 3843691ddf5f..0c65e897f501 100644
--- a/icu4c/source/i18n/unicode/tblcoll.h
+++ b/icu4c/source/i18n/unicode/tblcoll.h
@@ -850,7 +850,7 @@ class U_I18N_API RuleBasedCollator final : public Collator {
}
UBool attributeHasBeenSetExplicitly(int32_t attribute) const {
// assert(0 <= attribute < ATTR_LIMIT);
- return static_cast((explicitlySetAttributes & (static_cast(1) << attribute)) != 0);
+ return (explicitlySetAttributes & (static_cast(1) << attribute)) != 0;
}
/**
diff --git a/icu4c/source/i18n/unum.cpp b/icu4c/source/i18n/unum.cpp
index 7e112d4ad732..d6d18abed1fa 100644
--- a/icu4c/source/i18n/unum.cpp
+++ b/icu4c/source/i18n/unum.cpp
@@ -485,7 +485,7 @@ unum_parseDoubleCurrency(const UNumberFormat* fmt,
if (U_FAILURE(*status)) {
return doubleVal;
}
- const UnicodeString src((UBool)(textLength == -1), text, textLength);
+ const UnicodeString src(textLength == -1, text, textLength);
ParsePosition pp;
if (parsePos != nullptr) {
pp.setIndex(*parsePos);
diff --git a/icu4c/source/io/ufile.cpp b/icu4c/source/io/ufile.cpp
index 67930fda544a..63954c5fe2eb 100644
--- a/icu4c/source/io/ufile.cpp
+++ b/icu4c/source/io/ufile.cpp
@@ -255,7 +255,7 @@ u_feof(UFILE *f)
if (f == nullptr) {
return true;
}
- endOfBuffer = (UBool)(f->str.fPos >= f->str.fLimit);
+ endOfBuffer = f->str.fPos >= f->str.fLimit;
if (f->fFile != nullptr) {
return endOfBuffer && feof(f->fFile);
}
diff --git a/icu4c/source/io/ufmt_cmn.cpp b/icu4c/source/io/ufmt_cmn.cpp
index 0202783f8b5e..7930fe30beb6 100644
--- a/icu4c/source/io/ufmt_cmn.cpp
+++ b/icu4c/source/io/ufmt_cmn.cpp
@@ -58,7 +58,7 @@ ufmt_isdigit(char16_t c,
{
int digitVal = ufmt_digitvalue(c);
- return static_cast(digitVal < radix && digitVal >= 0);
+ return digitVal < radix && digitVal >= 0;
}
#define TO_UC_DIGIT(a) a <= 9 ? (DIGIT_0 + a) : (0x0037 + a)
diff --git a/icu4c/source/test/cintltst/capitst.c b/icu4c/source/test/cintltst/capitst.c
index 4797096310b7..2da8cd29adb5 100644
--- a/icu4c/source/test/cintltst/capitst.c
+++ b/icu4c/source/test/cintltst/capitst.c
@@ -1282,8 +1282,8 @@ void TestSortKey(void)
for(i=0;i U_CNV_SAFECLONE_BUFFERSIZE) {
log_err("ucnv_safeClone(): max preflighted clone size=%d (%s) is larger than U_CNV_SAFECLONE_BUFFERSIZE=%d\n",
- maxBufferSize, maxName, (int)U_CNV_SAFECLONE_BUFFERSIZE);
+ maxBufferSize, maxName, U_CNV_SAFECLONE_BUFFERSIZE);
}
}
diff --git a/icu4c/source/test/cintltst/chashtst.c b/icu4c/source/test/cintltst/chashtst.c
index a4b774d93a1c..729b9b9c3ae0 100644
--- a/icu4c/source/test/cintltst/chashtst.c
+++ b/icu4c/source/test/cintltst/chashtst.c
@@ -379,9 +379,9 @@ static int32_t U_EXPORT2 U_CALLCONV hashChars(const UHashTok key) {
}
static UBool U_EXPORT2 U_CALLCONV isEqualChars(const UHashTok key1, const UHashTok key2) {
- return (UBool)((key1.pointer != NULL) &&
- (key2.pointer != NULL) &&
- (uprv_strcmp((const char*)key1.pointer, (const char*)key2.pointer) == 0));
+ return key1.pointer != NULL &&
+ key2.pointer != NULL &&
+ uprv_strcmp((const char*)key1.pointer, (const char*)key2.pointer) == 0;
}
/**********************************************************************
diff --git a/icu4c/source/test/cintltst/cintltst.c b/icu4c/source/test/cintltst/cintltst.c
index 4c6d5fc6dec7..ab82fde24750 100644
--- a/icu4c/source/test/cintltst/cintltst.c
+++ b/icu4c/source/test/cintltst/cintltst.c
@@ -247,10 +247,10 @@ int main(int argc, const char* const argv[])
endTime = uprv_getRawUTCtime();
diffTime = (int32_t)(endTime - startTime);
printf("Elapsed Time: %02d:%02d:%02d.%03d\n",
- (int)((diffTime%U_MILLIS_PER_DAY)/U_MILLIS_PER_HOUR),
- (int)((diffTime%U_MILLIS_PER_HOUR)/U_MILLIS_PER_MINUTE),
- (int)((diffTime%U_MILLIS_PER_MINUTE)/U_MILLIS_PER_SECOND),
- (int)(diffTime%U_MILLIS_PER_SECOND));
+ (diffTime % U_MILLIS_PER_DAY) / U_MILLIS_PER_HOUR,
+ (diffTime % U_MILLIS_PER_HOUR) / U_MILLIS_PER_MINUTE,
+ (diffTime % U_MILLIS_PER_MINUTE) / U_MILLIS_PER_SECOND,
+ (diffTime % U_MILLIS_PER_SECOND));
return nerrors ? 1 : 0;
}
@@ -723,7 +723,7 @@ U_CFUNC UBool assertTrue(const char* msg, int /*not UBool*/ condition) {
log_verbose("Ok: %s\n", msg);
}
#endif
- return (UBool)condition;
+ return condition;
}
U_CFUNC UBool assertEquals(const char* message, const char* expected,
diff --git a/icu4c/source/test/cintltst/crestst.c b/icu4c/source/test/cintltst/crestst.c
index 7d0476462e66..f32dce366eac 100644
--- a/icu4c/source/test/cintltst/crestst.c
+++ b/icu4c/source/test/cintltst/crestst.c
@@ -428,7 +428,7 @@ UBool testTag(const char* frag,
ures_close(theBundle);
}
free(base);
- return (UBool)(passNum == pass);
+ return passNum == pass;
}
void record_pass(void)
diff --git a/icu4c/source/test/cintltst/creststn.c b/icu4c/source/test/cintltst/creststn.c
index 4877d8b49ccf..d5b0bb4febf8 100644
--- a/icu4c/source/test/cintltst/creststn.c
+++ b/icu4c/source/test/cintltst/creststn.c
@@ -2055,7 +2055,7 @@ static UBool testTag(const char* frag,
ures_close(tags);
ures_close(arrayItem1);
free(base);
- return (UBool)(failNum == fail);
+ return failNum == fail;
}
static void record_pass(void)
diff --git a/icu4c/source/test/cintltst/nccbtst.c b/icu4c/source/test/cintltst/nccbtst.c
index 825e918192fc..77f84a5ff089 100644
--- a/icu4c/source/test/cintltst/nccbtst.c
+++ b/icu4c/source/test/cintltst/nccbtst.c
@@ -2713,8 +2713,8 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
status = U_ZERO_ERROR;
ucnv_fromUnicode (conv,
- (char **)&targ,
- (const char *)end,
+ &targ,
+ end,
&src,
sourceLimit,
checkOffsets ? offs : NULL,
@@ -2911,8 +2911,8 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e
ucnv_toUnicode (conv,
&targ,
end,
- (const char **)&src,
- (const char *)srcLimit,
+ &src,
+ srcLimit,
checkOffsets ? offs : NULL,
(UBool)(srcLimit == realSourceEnd), /* flush if we're at the end of the source data */
&status);
@@ -3104,8 +3104,8 @@ UBool testConvertFromUnicodeWithContext(const UChar *source, int sourceLen, con
status = U_ZERO_ERROR;
ucnv_fromUnicode (conv,
- (char **)&targ,
- (const char *)end,
+ &targ,
+ end,
&src,
sourceLimit,
checkOffsets ? offs : NULL,
@@ -3284,8 +3284,8 @@ UBool testConvertToUnicodeWithContext( const uint8_t *source, int sourcelen, con
ucnv_toUnicode (conv,
&targ,
end,
- (const char **)&src,
- (const char *)srcLimit,
+ &src,
+ srcLimit,
checkOffsets ? offs : NULL,
(UBool)(srcLimit == realSourceEnd), /* flush if we're at the end of the source data */
&status);
diff --git a/icu4c/source/test/cintltst/ncnvfbts.c b/icu4c/source/test/cintltst/ncnvfbts.c
index 1aded8e4eafb..ac52397395a8 100644
--- a/icu4c/source/test/cintltst/ncnvfbts.c
+++ b/icu4c/source/test/cintltst/ncnvfbts.c
@@ -209,8 +209,8 @@ static UBool testConvertFromUnicode(const UChar *source, int sourceLen, const u
status = U_ZERO_ERROR;
ucnv_fromUnicode (conv,
- (char **)&targ,
- (const char *)end,
+ &targ,
+ end,
&src,
sourceLimit,
checkOffsets ? offs : NULL,
@@ -374,8 +374,8 @@ static UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const U
ucnv_toUnicode (conv,
&targ,
end,
- (const char **)&src,
- (const char *)srcLimit,
+ &src,
+ srcLimit,
checkOffsets ? offs : NULL,
(UBool)(srcLimit == realSourceEnd), /* flush if we're at the end of the source data */
&status);
diff --git a/icu4c/source/test/cintltst/ncnvtst.c b/icu4c/source/test/cintltst/ncnvtst.c
index 77b45db53274..2d695a6e5769 100644
--- a/icu4c/source/test/cintltst/ncnvtst.c
+++ b/icu4c/source/test/cintltst/ncnvtst.c
@@ -1027,8 +1027,8 @@ static UBool convertFromU( const UChar *source, int sourceLen, const uint8_t *e
targetLimit=targ+MAX_LENGTH;
offs=offsetBuffer;
ucnv_fromUnicode (conv,
- (char **)&targ,
- (const char *)targetLimit,
+ &targ,
+ targetLimit,
&src,
sourceLimit,
expectOffsets ? offs : NULL,
@@ -1125,7 +1125,7 @@ static UBool convertToU( const uint8_t *source, int sourceLen, const UChar *expe
ucnv_toUnicode (conv,
&targ,
targetLimit,
- (const char **)&src,
+ &src,
(const char *)sourceLimit,
expectOffsets ? offs : NULL,
doFlush,
@@ -1259,8 +1259,8 @@ static UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_
if(gInBufferSize ==999 && gOutBufferSize==999)
doFlush = false;
ucnv_fromUnicode (conv,
- (char **)&targ,
- (const char *)end,
+ &targ,
+ end,
&src,
sourceLimit,
offs,
@@ -1434,8 +1434,8 @@ static UBool testConvertToU( const uint8_t *source, int sourcelen, const UChar *
ucnv_toUnicode (conv,
&targ,
end,
- (const char **)&src,
- (const char *)srcLimit,
+ &src,
+ srcLimit,
offs,
doFlush, /* flush if we're at the end of the source data */
&status);
diff --git a/icu4c/source/test/cintltst/nucnvtst.c b/icu4c/source/test/cintltst/nucnvtst.c
index 6c97419f4cd8..294b6f43de9f 100644
--- a/icu4c/source/test/cintltst/nucnvtst.c
+++ b/icu4c/source/test/cintltst/nucnvtst.c
@@ -456,12 +456,12 @@ static ETestConvertResult testConvertFromU( const UChar *source, int sourceLen,
junk[0] = 0;
offset_str[0] = 0;
for(ptr = junkout;ptr0; ){
uSource = (UChar*) source;
- uSourceLimit=(const UChar*)sourceLimit;
+ uSourceLimit = sourceLimit;
cTarget = cBuf;
uTarget = uBuf;
cSource = cBuf;
@@ -2993,7 +2993,7 @@ TestGetNextUChar2022(UConverter* cnv, const char* source, const char* limit,
}else{
exC = *r;
}
- if(c!=(uint32_t)(exC))
+ if (c != exC)
log_err("%s ucnv_getNextUChar() Expected: \\u%04X Got: \\u%04X \n",message,(uint32_t) (*r),c);
}
r++;
@@ -5084,7 +5084,7 @@ TestLMBCS(void) {
pUniIn = uniString;
ucnv_toUnicode (cnv01us,
&pUniIn, pUniIn + 1,
- &pLMBCSOut, (const char *)(pLMBCSOut + 3),
+ &pLMBCSOut, pLMBCSOut + 3,
NULL, 1, &errorCode);
if (U_FAILURE(errorCode) || pLMBCSOut != (const char *)lmbcsString+3 || pUniIn != uniString+1 || uniString[0] != 0xFF6E)
{
@@ -5185,14 +5185,14 @@ TestLMBCS(void) {
pUIn--;
errorCode=U_ZERO_ERROR;
- ucnv_toUnicode(cnv, &pUOut,pUOut+1,(const char **)&pLIn,(const char *)(pLIn-1),off,false, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + 1, &pLIn, pLIn - 1, off, false, &errorCode);
if (errorCode != U_ILLEGAL_ARGUMENT_ERROR)
{
log_err("Unexpected Error on negative source request to ucnv_toUnicode: %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
- uniChar = ucnv_getNextUChar(cnv, (const char **)&pLIn, (const char *)(pLIn-1), &errorCode);
+ uniChar = ucnv_getNextUChar(cnv, &pLIn, pLIn - 1, &errorCode);
if (errorCode != U_ILLEGAL_ARGUMENT_ERROR)
{
log_err("Unexpected Error on negative source request to ucnv_getNextUChar: %s\n", u_errorName(errorCode));
@@ -5200,7 +5200,7 @@ TestLMBCS(void) {
errorCode=U_ZERO_ERROR;
/* 0 byte source request - no error, no pointer movement */
- ucnv_toUnicode(cnv, &pUOut,pUOut+1,(const char **)&pLIn,(const char *)pLIn,off,false, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + 1, &pLIn, pLIn, off, false, &errorCode);
ucnv_fromUnicode(cnv, &pLOut,pLOut+1,&pUIn,pUIn,off,false, &errorCode);
if(U_FAILURE(errorCode)) {
log_err("0 byte source request: unexpected error: %s\n", u_errorName(errorCode));
@@ -5210,7 +5210,7 @@ TestLMBCS(void) {
log_err("Unexpected pointer move in 0 byte source request \n");
}
/*0 byte source request - GetNextUChar : error & value == fffe or ffff */
- uniChar = ucnv_getNextUChar(cnv, (const char **)&pLIn, (const char *)pLIn, &errorCode);
+ uniChar = ucnv_getNextUChar(cnv, &pLIn, pLIn, &errorCode);
if (errorCode != U_INDEX_OUTOFBOUNDS_ERROR)
{
log_err("Unexpected Error on 0-byte source request to ucnv_getnextUChar: %s\n", u_errorName(errorCode));
@@ -5252,7 +5252,7 @@ TestLMBCS(void) {
pUOut = UOut;
ucnv_setToUCallBack(cnv, UCNV_TO_U_CALLBACK_STOP, NULL, NULL, NULL, &errorCode);
- ucnv_toUnicode(cnv, &pUOut,pUOut+UPRV_LENGTHOF(UOut),(const char **)&pLIn,(const char *)(pLIn+5),off,true, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + UPRV_LENGTHOF(UOut), &pLIn, pLIn + 5, off, true, &errorCode);
if (UOut[0] != 0xD801 || errorCode != U_TRUNCATED_CHAR_FOUND || pUOut != UOut + 1 || pLIn != LIn + 5)
{
log_err("Unexpected results on chopped low surrogate\n");
@@ -5266,7 +5266,7 @@ TestLMBCS(void) {
errorCode = U_ZERO_ERROR;
pUOut = UOut;
- ucnv_toUnicode(cnv, &pUOut,pUOut+UPRV_LENGTHOF(UOut),(const char **)&pLIn,(const char *)(pLIn+3),off,true, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + UPRV_LENGTHOF(UOut), &pLIn, pLIn + 3, off, true, &errorCode);
if (UOut[0] != 0xD801 || U_FAILURE(errorCode) || pUOut != UOut + 1 || pLIn != LIn + 3)
{
log_err("Unexpected results on chopped at surrogate boundary \n");
@@ -5283,7 +5283,7 @@ TestLMBCS(void) {
errorCode = U_ZERO_ERROR;
pUOut = UOut;
- ucnv_toUnicode(cnv, &pUOut,pUOut+UPRV_LENGTHOF(UOut),(const char **)&pLIn,(const char *)(pLIn+6),off,true, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + UPRV_LENGTHOF(UOut), &pLIn, pLIn + 6, off, true, &errorCode);
if (UOut[0] != 0xD801 || UOut[1] != 0xC9D0 || U_FAILURE(errorCode) || pUOut != UOut + 2 || pLIn != LIn + 6)
{
log_err("Unexpected results after unpaired surrogate plus valid Unichar \n");
@@ -5300,7 +5300,7 @@ TestLMBCS(void) {
errorCode = U_ZERO_ERROR;
pUOut = UOut;
- ucnv_toUnicode(cnv, &pUOut,pUOut+UPRV_LENGTHOF(UOut),(const char **)&pLIn,(const char *)(pLIn+5),off,true, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + UPRV_LENGTHOF(UOut), &pLIn, pLIn + 5, off, true, &errorCode);
if (UOut[0] != 0xD801 || errorCode != U_TRUNCATED_CHAR_FOUND || pUOut != UOut + 1 || pLIn != LIn + 5)
{
log_err("Unexpected results after unpaired surrogate plus chopped Unichar \n");
@@ -5317,7 +5317,7 @@ TestLMBCS(void) {
errorCode = U_ZERO_ERROR;
pUOut = UOut;
- ucnv_toUnicode(cnv, &pUOut,pUOut+UPRV_LENGTHOF(UOut),(const char **)&pLIn,(const char *)(pLIn+5),off,true, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + UPRV_LENGTHOF(UOut), &pLIn, pLIn + 5, off, true, &errorCode);
if (UOut[0] != 0xD801 || UOut[1] != 0x1B || U_FAILURE(errorCode) || pUOut != UOut + 2 || pLIn != LIn + 5)
{
log_err("Unexpected results after unpaired surrogate plus valid non-Unichar\n");
@@ -5333,7 +5333,7 @@ TestLMBCS(void) {
errorCode = U_ZERO_ERROR;
pUOut = UOut;
- ucnv_toUnicode(cnv, &pUOut,pUOut+UPRV_LENGTHOF(UOut),(const char **)&pLIn,(const char *)(pLIn+4),off,true, &errorCode);
+ ucnv_toUnicode(cnv, &pUOut, pUOut + UPRV_LENGTHOF(UOut), &pLIn, pLIn + 4, off, true, &errorCode);
if (UOut[0] != 0xD801 || errorCode != U_TRUNCATED_CHAR_FOUND || pUOut != UOut + 1 || pLIn != LIn + 4)
{
@@ -5390,7 +5390,7 @@ static void TestEBCDICUS4XML(void)
log_data_err("Failed to open the converter for EBCDIC-XML-US.\n");
return;
}
- ucnv_toUnicode(cnv, &unicodes, unicodes+3, (const char**)&newLines, newLines+3, NULL, true, &status);
+ ucnv_toUnicode(cnv, &unicodes, unicodes + 3, &newLines, newLines + 3, NULL, true, &status);
if (U_FAILURE(status) || memcmp(unicodes_x, toUnicodeMaps, sizeof(UChar)*3) != 0) {
log_err("To Unicode conversion failed in EBCDICUS4XML test. %s\n",
u_errorName(status));
@@ -5398,7 +5398,7 @@ static void TestEBCDICUS4XML(void)
printUSeqErr(toUnicodeMaps, 3);
}
status = U_ZERO_ERROR;
- ucnv_fromUnicode(cnv, &target, target+3, (const UChar**)&toUnicodeMaps, toUnicodeMaps+3, NULL, true, &status);
+ ucnv_fromUnicode(cnv, &target, target + 3, &toUnicodeMaps, toUnicodeMaps + 3, NULL, true, &status);
if (U_FAILURE(status) || memcmp(target_x, fromUnicodeMaps, sizeof(char)*3) != 0) {
log_err("From Unicode conversion failed in EBCDICUS4XML test. %s\n",
u_errorName(status));
diff --git a/icu4c/source/test/cintltst/trie2test.c b/icu4c/source/test/cintltst/trie2test.c
index d3c50a125ad1..a1459773607b 100644
--- a/icu4c/source/test/cintltst/trie2test.c
+++ b/icu4c/source/test/cintltst/trie2test.c
@@ -477,7 +477,7 @@ testTrieUTF8(const char *testName,
}
if(i8!=(p-s)) {
log_err("error: wrong end index from UTRIE2_U8_NEXT(%s)(from %d %lx->U+%04lx): %ld != %ld\n",
- testName, (int)prev8, (unsigned long)bytes, (long)c, (long)(p-s), (long)i8);
+ testName, (int)prev8, (unsigned long)bytes, (long)c, p - s, (long)i8);
continue;
}
++i;
@@ -510,7 +510,7 @@ testTrieUTF8(const char *testName,
}
if(i8!=(p-s)) {
log_err("error: wrong end index from UTRIE2_U8_PREV(%s)(from %d %lx->U+%04lx): %ld != %ld\n",
- testName, (int)prev8, (unsigned long)bytes, (long)c, (long)(p-s), (long)i8);
+ testName, (int)prev8, (unsigned long)bytes, (long)c, p - s, (long)i8);
continue;
}
}
diff --git a/icu4c/source/test/cintltst/ucptrietest.c b/icu4c/source/test/cintltst/ucptrietest.c
index 1a75a3a2f0dc..df32389bceec 100644
--- a/icu4c/source/test/cintltst/ucptrietest.c
+++ b/icu4c/source/test/cintltst/ucptrietest.c
@@ -636,7 +636,7 @@ testTrieUTF8(const char *testName,
log_err("error: wrong end index from UCPTRIE_FAST_U8_NEXT(%s)(from %d %lx->U+%04lx): "
"%ld != %ld (bytes %lx)\n",
testName, (int)prev8, (unsigned long)actualBytes, (long)c,
- (long)(p-s), (long)i8, (unsigned long)expectedBytes);
+ p - s, (long)i8, (unsigned long)expectedBytes);
break;
}
++i;
@@ -682,7 +682,7 @@ testTrieUTF8(const char *testName,
log_err("error: wrong end index from UCPTRIE_FAST_U8_PREV(%s)(from %d %lx->U+%04lx): "
"%ld != %ld (bytes %lx)\n",
testName, (int)prev8, (unsigned long)actualBytes, (long)c,
- (long)(p-s), (long)i8, (unsigned long)expectedBytes);
+ p - s, (long)i8, (unsigned long)expectedBytes);
break;
}
}
diff --git a/icu4c/source/test/cintltst/udatatst.c b/icu4c/source/test/cintltst/udatatst.c
index 548971b17df0..fc1ab786ad34 100644
--- a/icu4c/source/test/cintltst/udatatst.c
+++ b/icu4c/source/test/cintltst/udatatst.c
@@ -1148,7 +1148,7 @@ static void TestICUDataName(void)
typeChar = 'l';
break;
default:
- log_err("Expected 1 or 0 for U_IS_BIG_ENDIAN, got %d!\n", (int)U_IS_BIG_ENDIAN);
+ log_err("Expected 1 or 0 for U_IS_BIG_ENDIAN, got %d!\n", U_IS_BIG_ENDIAN);
/* return; */
}
break;
diff --git a/icu4c/source/test/intltest/idnaref.cpp b/icu4c/source/test/intltest/idnaref.cpp
index 92091efeda41..d08c5582493e 100644
--- a/icu4c/source/test/intltest/idnaref.cpp
+++ b/icu4c/source/test/intltest/idnaref.cpp
@@ -276,8 +276,8 @@ idnaref_toASCII(const char16_t* src, int32_t srcLength,
reqLength=0;
//get the options
- UBool allowUnassigned = (UBool)((options & IDNAREF_ALLOW_UNASSIGNED) != 0);
- UBool useSTD3ASCIIRules = (UBool)((options & IDNAREF_USE_STD3_RULES) != 0);
+ UBool allowUnassigned = (options & IDNAREF_ALLOW_UNASSIGNED) != 0;
+ UBool useSTD3ASCIIRules = (options & IDNAREF_USE_STD3_RULES) != 0;
UBool* caseFlags = nullptr;
@@ -455,8 +455,8 @@ idnaref_toUnicode(const char16_t* src, int32_t srcLength,
UBool* caseFlags = nullptr;
//get the options
- UBool allowUnassigned = (UBool)((options & IDNAREF_ALLOW_UNASSIGNED) != 0);
- UBool useSTD3ASCIIRules = (UBool)((options & IDNAREF_USE_STD3_RULES) != 0);
+ UBool allowUnassigned = (options & IDNAREF_ALLOW_UNASSIGNED) != 0;
+ UBool useSTD3ASCIIRules = (options & IDNAREF_USE_STD3_RULES) != 0;
UBool srcIsASCII = true;
UBool srcIsLDH = true;
diff --git a/icu4c/source/test/intltest/messageformat2test.cpp b/icu4c/source/test/intltest/messageformat2test.cpp
index 524ee4ab79d9..353082ef5c91 100644
--- a/icu4c/source/test/intltest/messageformat2test.cpp
+++ b/icu4c/source/test/intltest/messageformat2test.cpp
@@ -30,6 +30,9 @@ TestMessageFormat2::runIndexedTest(int32_t index, UBool exec,
TESTCASE_AUTO(testAPI);
TESTCASE_AUTO(testAPISimple);
TESTCASE_AUTO(testDataModelAPI);
+ TESTCASE_AUTO(testFormatterAPI);
+ TESTCASE_AUTO(testHighLoneSurrogate);
+ TESTCASE_AUTO(testLowLoneSurrogate);
TESTCASE_AUTO(dataDrivenTests);
TESTCASE_AUTO_END;
}
@@ -64,6 +67,77 @@ void TestMessageFormat2::testDataModelAPI() {
assertEquals("testDataModelAPI", i, 3);
}
+// Needs more tests
+void TestMessageFormat2::testFormatterAPI() {
+ IcuTestErrorCode errorCode(*this, "testFormatterAPI");
+ UnicodeString result;
+ UParseError parseError;
+
+ // Check that constructing the formatter fails
+ // if there's a syntax error
+ UnicodeString pattern = "{{}";
+ MessageFormatter::Builder mfBuilder(errorCode);
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_BEST_EFFORT); // This shouldn't matter, since there's a syntax error
+ mfBuilder.setPattern(pattern, parseError, errorCode);
+ MessageFormatter mf = mfBuilder.build(errorCode);
+ errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR,
+ "testFormatterAPI: expected syntax error, best-effort error handling");
+
+ // Parsing is done when setPattern() is called,
+ // so setErrorHandlingBehavior(MessageFormatter::U_MF_STRICT) or setSuppressErrors must be called
+ // _before_ setPattern() to get the right behavior,
+ // and if either method is called after setting a pattern,
+ // setPattern() has to be called again.
+
+ // Should get the same behavior with strict errors
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_STRICT);
+ // Force re-parsing, as above comment
+ mfBuilder.setPattern(pattern, parseError, errorCode);
+ mf = mfBuilder.build(errorCode);
+ errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR,
+ "testFormatterAPI: expected syntax error, strict error handling");
+
+ // Try the same thing for a pattern with a resolution error
+ pattern = "{{{$x}}}";
+ // Check that a pattern with a resolution error gives fallback output
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_BEST_EFFORT);
+ mfBuilder.setPattern(pattern, parseError, errorCode);
+ mf = mfBuilder.build(errorCode);
+ errorCode.errIfFailureAndReset("testFormatterAPI: expected success from builder, best-effort error handling");
+ result = mf.formatToString(MessageArguments(), errorCode);
+ errorCode.errIfFailureAndReset("testFormatterAPI: expected success from formatter, best-effort error handling");
+ assertEquals("testFormatterAPI: fallback for message with unresolved variable",
+ result, "{$x}");
+
+ // Check that we do get an error with strict errors
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_STRICT);
+ mf = mfBuilder.build(errorCode);
+ errorCode.errIfFailureAndReset("testFormatterAPI: builder should succeed with resolution error");
+ result = mf.formatToString(MessageArguments(), errorCode);
+ errorCode.expectErrorAndReset(U_MF_UNRESOLVED_VARIABLE_ERROR,
+ "testFormatterAPI: formatting should fail with resolution error and strict error handling");
+
+ // Finally, check a valid pattern
+ pattern = "hello";
+ mfBuilder.setPattern(pattern, parseError, errorCode);
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_BEST_EFFORT);
+ mf = mfBuilder.build(errorCode);
+ errorCode.errIfFailureAndReset("testFormatterAPI: expected success from builder with valid pattern, best-effort error handling");
+ result = mf.formatToString(MessageArguments(), errorCode);
+ errorCode.errIfFailureAndReset("testFormatterAPI: expected success from formatter with valid pattern, best-effort error handling");
+ assertEquals("testFormatterAPI: wrong output with valid pattern, best-effort error handling",
+ result, "hello");
+
+ // Check that behavior is the same with strict errors
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_STRICT);
+ mf = mfBuilder.build(errorCode);
+ errorCode.errIfFailureAndReset("testFormatterAPI: expected success from builder with valid pattern, strict error handling");
+ result = mf.formatToString(MessageArguments(), errorCode);
+ errorCode.errIfFailureAndReset("testFormatterAPI: expected success from formatter with valid pattern, strict error handling");
+ assertEquals("testFormatterAPI: wrong output with valid pattern, strict error handling",
+ result, "hello");
+}
+
// Example for design doc -- version without null and error checks
void TestMessageFormat2::testAPISimple() {
IcuTestErrorCode errorCode1(*this, "testAPI");
@@ -216,9 +290,11 @@ void TestMessageFormat2::testAPICustomFunctions() {
MessageFormatter::Builder mfBuilder(errorCode);
UnicodeString result;
// This fails, because we did not provide a function registry:
- MessageFormatter mf = mfBuilder.setPattern("Hello {$name :person formality=informal}", parseError, errorCode)
- .setLocale(locale)
- .build(errorCode);
+ MessageFormatter mf = mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_STRICT)
+ .setPattern("Hello {$name :person formality=informal}",
+ parseError, errorCode)
+ .setLocale(locale)
+ .build(errorCode);
result = mf.formatToString(arguments, errorCode);
assertEquals("testAPICustomFunctions", U_MF_UNKNOWN_FUNCTION_ERROR, errorCode);
@@ -263,6 +339,34 @@ void TestMessageFormat2::testAPICustomFunctions() {
delete person;
}
+// ICU-22890 lone surrogate cause infinity loop
+void TestMessageFormat2::testHighLoneSurrogate() {
+ IcuTestErrorCode errorCode(*this, "testHighLoneSurrogate");
+ UParseError pe = { 0, 0, {0}, {0} };
+ // Lone surrogate with only high surrogate
+ UnicodeString loneSurrogate({0xda02, 0});
+ icu::message2::MessageFormatter msgfmt1 =
+ icu::message2::MessageFormatter::Builder(errorCode)
+ .setPattern(loneSurrogate, pe, errorCode)
+ .build(errorCode);
+ UnicodeString result = msgfmt1.formatToString({}, errorCode);
+ errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR, "testHighLoneSurrogate");
+}
+
+// ICU-22890 lone surrogate cause infinity loop
+void TestMessageFormat2::testLowLoneSurrogate() {
+ IcuTestErrorCode errorCode(*this, "testLowLoneSurrogate");
+ UParseError pe = { 0, 0, {0}, {0} };
+ // Lone surrogate with only low surrogate
+ UnicodeString loneSurrogate({0xdc02, 0});
+ icu::message2::MessageFormatter msgfmt2 =
+ icu::message2::MessageFormatter::Builder(errorCode)
+ .setPattern(loneSurrogate, pe, errorCode)
+ .build(errorCode);
+ UnicodeString result = msgfmt2.formatToString({}, errorCode);
+ errorCode.expectErrorAndReset(U_MF_SYNTAX_ERROR, "testLowLoneSurrogate");
+}
+
void TestMessageFormat2::dataDrivenTests() {
IcuTestErrorCode errorCode(*this, "jsonTests");
diff --git a/icu4c/source/test/intltest/messageformat2test.h b/icu4c/source/test/intltest/messageformat2test.h
index 7c7c2612f50d..71dfb3916c9b 100644
--- a/icu4c/source/test/intltest/messageformat2test.h
+++ b/icu4c/source/test/intltest/messageformat2test.h
@@ -45,6 +45,8 @@ class TestMessageFormat2: public IntlTest {
void testCustomFunctions(void);
// Test the data model API
void testDataModelAPI(void);
+ // Test the formatting API
+ void testFormatterAPI(void);
void testAPI(void);
void testAPISimple(void);
@@ -87,6 +89,8 @@ class TestMessageFormat2: public IntlTest {
void testMessageFormatDateTimeSkeleton(message2::TestCase::Builder&, IcuTestErrorCode&);
void testMf1Behavior(message2::TestCase::Builder&, IcuTestErrorCode&);
+ void testHighLoneSurrogate(void);
+ void testLowLoneSurrogate(void);
}; // class TestMessageFormat2
U_NAMESPACE_BEGIN
diff --git a/icu4c/source/test/intltest/messageformat2test_utils.h b/icu4c/source/test/intltest/messageformat2test_utils.h
index 08cdd57bfa72..c4ad251c7f48 100644
--- a/icu4c/source/test/intltest/messageformat2test_utils.h
+++ b/icu4c/source/test/intltest/messageformat2test_utils.h
@@ -228,22 +228,32 @@ class TestUtils {
if (testCase.hasCustomRegistry()) {
mfBuilder.setFunctionRegistry(*testCase.getCustomRegistry());
}
+ // Initially, set error behavior to strict.
+ // We'll re-run to check for errors.
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_STRICT);
MessageFormatter mf = mfBuilder.build(errorCode);
UnicodeString result;
+ // Builder should fail if a syntax error was expected
+ if (!testCase.expectSuccess() && testCase.expectedErrorCode() == U_MF_SYNTAX_ERROR) {
+ if (errorCode != testCase.expectedErrorCode()) {
+ failExpectedFailure(tmsg, testCase, errorCode);
+ }
+ errorCode.reset();
+ return;
+ }
+
if (U_SUCCESS(errorCode)) {
result = mf.formatToString(MessageArguments(testCase.getArguments(), errorCode), errorCode);
}
- if (testCase.expectSuccess() || (testCase.expectedErrorCode() != U_MF_SYNTAX_ERROR
- // For now, don't round-trip messages with these errors,
- // since duplicate options are dropped
- && testCase.expectedErrorCode() != U_MF_DUPLICATE_OPTION_NAME_ERROR)) {
- const UnicodeString& in = mf.getNormalizedPattern();
- UnicodeString out;
- if (!roundTrip(in, mf.getDataModel(), out)) {
- failRoundTrip(tmsg, testCase, in, out);
- }
+ const UnicodeString& in = mf.getNormalizedPattern();
+ UnicodeString out;
+ if (!roundTrip(in, mf.getDataModel(), out)
+ // For now, don't round-trip messages with these errors,
+ // since duplicate options are dropped
+ && testCase.expectedErrorCode() != U_MF_DUPLICATE_OPTION_NAME_ERROR) {
+ failRoundTrip(tmsg, testCase, in, out);
}
if (testCase.expectNoSyntaxError()) {
@@ -264,9 +274,27 @@ class TestUtils {
if (!testCase.lineNumberAndOffsetMatch(parseError.line, parseError.offset)) {
failWrongOffset(tmsg, testCase, parseError.line, parseError.offset);
}
- if (!testCase.outputMatches(result)) {
- failWrongOutput(tmsg, testCase, result);
- return;
+ if (U_FAILURE(errorCode) && !testCase.expectSuccess()
+ && testCase.expectedErrorCode() != U_MF_SYNTAX_ERROR) {
+ // Re-run the formatter if there was an error,
+ // in order to get best-effort output
+ errorCode.reset();
+ mfBuilder.setErrorHandlingBehavior(MessageFormatter::U_MF_BEST_EFFORT);
+ mf = mfBuilder.build(errorCode);
+ if (U_SUCCESS(errorCode)) {
+ result = mf.formatToString(MessageArguments(testCase.getArguments(), errorCode), errorCode);
+ }
+ if (U_FAILURE(errorCode)) {
+ // Must be a non-MF2 error code
+ U_ASSERT(!(errorCode >= U_MF_UNRESOLVED_VARIABLE_ERROR
+ && errorCode <= U_FMT_PARSE_ERROR_LIMIT));
+ }
+ // Re-run the formatter
+ result = mf.formatToString(MessageArguments(testCase.getArguments(), errorCode), errorCode);
+ if (!testCase.outputMatches(result)) {
+ failWrongOutput(tmsg, testCase, result);
+ return;
+ }
}
errorCode.reset();
}
@@ -278,7 +306,7 @@ class TestUtils {
static void failSyntaxError(IntlTest& tmsg, const TestCase& testCase) {
tmsg.dataerrln(testCase.getTestName());
- tmsg.logln(testCase.getTestName() + " failed test with pattern: " + testCase.getPattern() + " and error code U_MF_SYNTAX_WARNING; expected no syntax error");
+ tmsg.logln(testCase.getTestName() + " failed test with pattern: " + testCase.getPattern() + " and error code U_MF_SYNTAX_ERROR; expected no syntax error");
}
static void failExpectedSuccess(IntlTest& tmsg, const TestCase& testCase, IcuTestErrorCode& errorCode, int32_t line, int32_t offset) {
diff --git a/icu4c/source/test/intltest/nptrans.cpp b/icu4c/source/test/intltest/nptrans.cpp
index aebf18104924..879fdfa16af3 100644
--- a/icu4c/source/test/intltest/nptrans.cpp
+++ b/icu4c/source/test/intltest/nptrans.cpp
@@ -122,7 +122,7 @@ NamePrepTransform::NamePrepTransform(UParseError& parseError, UErrorCode& status
UBool NamePrepTransform::isProhibited(UChar32 ch){
- return static_cast(ch != ASCII_SPACE);
+ return ch != ASCII_SPACE;
}
NamePrepTransform::~NamePrepTransform(){
diff --git a/icu4c/source/test/intltest/restest.cpp b/icu4c/source/test/intltest/restest.cpp
index 381dfa25627a..661312ad5316 100644
--- a/icu4c/source/test/intltest/restest.cpp
+++ b/icu4c/source/test/intltest/restest.cpp
@@ -499,12 +499,12 @@ ResourceBundleTest::testTag(const char* frag,
else if (status != expected_resource_status)
{
record_fail("Error getting " + UnicodeString(tag));
- return static_cast(failOrig != fail);
+ return failOrig != fail;
}
}
- return static_cast(failOrig != fail);
+ return failOrig != fail;
}
void
diff --git a/icu4c/source/test/intltest/restsnew.cpp b/icu4c/source/test/intltest/restsnew.cpp
index 1bdfa2140781..a7bbf7717d9b 100644
--- a/icu4c/source/test/intltest/restsnew.cpp
+++ b/icu4c/source/test/intltest/restsnew.cpp
@@ -1051,7 +1051,7 @@ NewResourceBundleTest::testTag(const char* frag,
CONFIRM_EQ(count, tag_count);
}
- return static_cast(failOrig == fail);
+ return failOrig == fail;
}
void
diff --git a/icu4c/source/test/intltest/usettest.cpp b/icu4c/source/test/intltest/usettest.cpp
index 18320f928fd7..a53e813ad2f7 100644
--- a/icu4c/source/test/intltest/usettest.cpp
+++ b/icu4c/source/test/intltest/usettest.cpp
@@ -2135,13 +2135,13 @@ UBool UnicodeSetTest::checkEqual(
UnicodeString source; s.toPattern(source, true);
UnicodeString result; t.toPattern(result, true);
if (s != t) {
- intlTest.errln((UnicodeString)"FAIL: " + message
+ intlTest.errln(UnicodeString("FAIL: ") + message
+ "\nsource = " + source
+ "\nresult = " + result
);
return false;
} else {
- intlTest.logln((UnicodeString)"Ok: " + message
+ intlTest.logln(UnicodeString("Ok: ") + message
+ "\nsource = " + source
+ "\nresult = " + result
);
@@ -2530,7 +2530,7 @@ class UnicodeSetWithStrings {
}
UBool hasStrings() const {
- return static_cast(stringsLength > 0);
+ return stringsLength > 0;
}
UBool hasStringsWithSurrogates() const {
diff --git a/icu4c/source/test/intltest/ustrtest.cpp b/icu4c/source/test/intltest/ustrtest.cpp
index ae371f68acc4..5df9d8e1fd44 100644
--- a/icu4c/source/test/intltest/ustrtest.cpp
+++ b/icu4c/source/test/intltest/ustrtest.cpp
@@ -2439,11 +2439,11 @@ void UnicodeStringTest::TestU16StringView() {
UnicodeString aliasFromSV = UnicodeString::readOnlyAlias(sv16);
assertTrue("aliasFromSV pointer alias", aliasFromSV.getBuffer() == sv16.data());
- assertEquals("aliasFromSV length", (int32_t)sv16.length(), aliasFromSV.length());
+ assertEquals("aliasFromSV length", static_cast(sv16.length()), aliasFromSV.length());
UnicodeString aliasFromStr = UnicodeString::readOnlyAlias(str16);
assertTrue("aliasFromStr pointer alias", aliasFromStr.getBuffer() == str16.data());
- assertEquals("aliasFromStr length", (int32_t)str16.length(), aliasFromStr.length());
+ assertEquals("aliasFromStr length", static_cast(str16.length()), aliasFromStr.length());
UnicodeString aliasFromUStr = UnicodeString::readOnlyAlias(ustr);
assertTrue("aliasFromUStr pointer alias", aliasFromUStr.getBuffer() == ustr.getBuffer());
@@ -2494,7 +2494,7 @@ void UnicodeStringTest::TestU16StringView() {
// Convert UnicodeString to string view.
std::u16string_view sv16FromUniStr(any);
assertTrue("sv16FromUniStr buffer alias", sv16FromUniStr.data() == any.getBuffer());
- assertEquals("sv16FromUniStr length", any.length(), (int32_t)sv16FromUniStr.length());
+ assertEquals("sv16FromUniStr length", any.length(), static_cast(sv16FromUniStr.length()));
// Just to show convenience: Convert UnicodeString to string view, then to std string.
std::u16string str16FromUniStr(any);
diff --git a/icu4c/source/test/intltest/utxttest.cpp b/icu4c/source/test/intltest/utxttest.cpp
index 66eb4eedb975..0293a6ca7170 100644
--- a/icu4c/source/test/intltest/utxttest.cpp
+++ b/icu4c/source/test/intltest/utxttest.cpp
@@ -1516,7 +1516,7 @@ void UTextTest::Ticket10983() {
void UTextTest::Ticket12130() {
UErrorCode status = U_ZERO_ERROR;
-
+
const char *text8 =
"Fundamentally, computers just deal with numbers. They store letters and other characters "
"by assigning a number for each one. Before Unicode was invented, there were hundreds "
@@ -1549,7 +1549,7 @@ void UTextTest::Ticket12130() {
if (expectedni != ni) {
errln("%s:%d utext_getNativeIndex() expected %d, got %d", __FILE__, __LINE__, expectedni, ni);
}
- if (0 != str.tempSubString(startIdx, 20).compare(extractBuffer)) {
+ if (0 != str.tempSubString(startIdx, 20).compare(extractBuffer)) {
errln("%s:%d utext_extract() failed. expected \"%s\", got \"%s\"",
__FILE__, __LINE__, CStr(str.tempSubString(startIdx, 20))(), CStr(UnicodeString(extractBuffer))());
}
@@ -1558,7 +1558,7 @@ void UTextTest::Ticket12130() {
// Similar utext extract, this time with the string length provided to the UText in advance,
// and a buffer of larger than required capacity.
-
+
utext_openUChars(&ut, ustr, str.length(), &status);
for (int32_t startIdx = 0; startIdxstart<=index<=chunk->limit.
* @return Chunk-relative UTF-16 offset corresponding to the specified native
* index.
@@ -1938,7 +1938,6 @@ utext_openUChar32s(UText *ut, const UChar32 *s, int64_t length, const char16_t *
}
-
void UTextTest::AccessChangesChunkSize() {
UErrorCode status = U_ZERO_ERROR;
UText ut = UTEXT_INITIALIZER;
@@ -1960,43 +1959,43 @@ void UTextTest::AccessChangesChunkSize() {
ut.pFuncs = &textFuncs;
// do test
- const OffsetAndChar *testEntryPtr = testAccessEntries;
- int32_t testCount = UPRV_LENGTHOF(testAccessEntries);
- for (; testCount-- > 0; testEntryPtr++) {
- utext_setNativeIndex(&ut, testEntryPtr->nativeOffset);
- int64_t beforeOffset = utext_getNativeIndex(&ut);
- UChar32 uchar = utext_current32(&ut);
- int64_t afterOffset = utext_getNativeIndex(&ut);
- if (uchar != testEntryPtr->expectChar || afterOffset != beforeOffset) {
- errln("utext_current32 unexpected behavior for u16, test case %lld: expected char %04X at offset %lld, got %04X at %lld;\n"
- "chunkNativeStart %lld chunkNativeLimit %lld nativeIndexingLimit %d chunkLength %d chunkOffset %d",
- static_cast(testEntryPtr - testAccessEntries), testEntryPtr->expectChar, beforeOffset, uchar, afterOffset,
- ut.chunkNativeStart, ut.chunkNativeLimit, ut.nativeIndexingLimit, ut.chunkLength, ut.chunkOffset);
- }
- }
- utext_close(&ut);
-
- ut = UTEXT_INITIALIZER;
- utext_openUChar32s(&ut, testAccess32Text, UPRV_LENGTHOF(testAccess32Text), testAccessText, &status);
+ const OffsetAndChar *testEntryPtr = testAccessEntries;
+ int32_t testCount = UPRV_LENGTHOF(testAccessEntries);
+ for (; testCount-- > 0; testEntryPtr++) {
+ utext_setNativeIndex(&ut, testEntryPtr->nativeOffset);
+ int64_t beforeOffset = utext_getNativeIndex(&ut);
+ UChar32 uchar = utext_current32(&ut);
+ int64_t afterOffset = utext_getNativeIndex(&ut);
+ if (uchar != testEntryPtr->expectChar || afterOffset != beforeOffset) {
+ errln("utext_current32 unexpected behavior for u16, test case %lld: expected char %04X at offset %lld, got %04X at %lld;\n"
+ "chunkNativeStart %lld chunkNativeLimit %lld nativeIndexingLimit %d chunkLength %d chunkOffset %d",
+ static_cast(testEntryPtr - testAccessEntries), testEntryPtr->expectChar, beforeOffset, uchar, afterOffset,
+ ut.chunkNativeStart, ut.chunkNativeLimit, ut.nativeIndexingLimit, ut.chunkLength, ut.chunkOffset);
+ }
+ }
+ utext_close(&ut);
+
+ ut = UTEXT_INITIALIZER;
+ utext_openUChar32s(&ut, testAccess32Text, UPRV_LENGTHOF(testAccess32Text), testAccessText, &status);
if (U_FAILURE(status)) {
errln("utext_openUChar32s failed: %s", u_errorName(status));
return;
}
// do test
- testEntryPtr = testAccess32Entries;
- testCount = UPRV_LENGTHOF(testAccess32Entries);
- for (; testCount-- > 0; testEntryPtr++) {
- utext_setNativeIndex(&ut, testEntryPtr->nativeOffset);
- int64_t beforeOffset = utext_getNativeIndex(&ut);
- UChar32 uchar = utext_current32(&ut);
- int64_t afterOffset = utext_getNativeIndex(&ut);
- if (uchar != testEntryPtr->expectChar || afterOffset != beforeOffset) {
- errln("utext_current32 unexpected behavior for u32, test case %lld: expected char %04X at offset %lld, got %04X at %lld;\n"
- "chunkNativeStart %lld chunkNativeLimit %lld nativeIndexingLimit %d chunkLength %d chunkOffset %d",
- static_cast(testEntryPtr - testAccess32Entries), testEntryPtr->expectChar, beforeOffset, uchar, afterOffset,
- ut.chunkNativeStart, ut.chunkNativeLimit, ut.nativeIndexingLimit, ut.chunkLength, ut.chunkOffset);
- }
- }
- utext_close(&ut);
+ testEntryPtr = testAccess32Entries;
+ testCount = UPRV_LENGTHOF(testAccess32Entries);
+ for (; testCount-- > 0; testEntryPtr++) {
+ utext_setNativeIndex(&ut, testEntryPtr->nativeOffset);
+ int64_t beforeOffset = utext_getNativeIndex(&ut);
+ UChar32 uchar = utext_current32(&ut);
+ int64_t afterOffset = utext_getNativeIndex(&ut);
+ if (uchar != testEntryPtr->expectChar || afterOffset != beforeOffset) {
+ errln("utext_current32 unexpected behavior for u32, test case %lld: expected char %04X at offset %lld, got %04X at %lld;\n"
+ "chunkNativeStart %lld chunkNativeLimit %lld nativeIndexingLimit %d chunkLength %d chunkOffset %d",
+ static_cast(testEntryPtr - testAccess32Entries), testEntryPtr->expectChar, beforeOffset, uchar, afterOffset,
+ ut.chunkNativeStart, ut.chunkNativeLimit, ut.nativeIndexingLimit, ut.chunkLength, ut.chunkOffset);
+ }
+ }
+ utext_close(&ut);
}
diff --git a/icu4c/source/test/perf/unisetperf/draft/bitset.cpp b/icu4c/source/test/perf/unisetperf/draft/bitset.cpp
index dc72cf4df237..d720b3827e4b 100644
--- a/icu4c/source/test/perf/unisetperf/draft/bitset.cpp
+++ b/icu4c/source/test/perf/unisetperf/draft/bitset.cpp
@@ -190,9 +190,9 @@ class BitSet : public UObject, public UnicodeContainable {
UBool contains(UChar32 c) const override {
if (static_cast(c) <= 0xff) {
- return static_cast((latin1Set[c >> 5] & (static_cast(1) << (c & 0x1f))) != 0);
+ return (latin1Set[c >> 5] & (static_cast(1) << (c & 0x1f))) != 0;
} else if (static_cast(c) < 0xffff) {
- return static_cast((bits[c >> 6] & (INT64_C(1) << (c & 0x3f))) != 0);
+ return (bits[c >> 6] & (INT64_C(1) << (c & 0x3f))) != 0;
} else {
return restSet->contains(c);
}
diff --git a/icu4c/source/test/perf/unisetperf/draft/trieset.cpp b/icu4c/source/test/perf/unisetperf/draft/trieset.cpp
index 9c15179216c1..d5406601fcef 100644
--- a/icu4c/source/test/perf/unisetperf/draft/trieset.cpp
+++ b/icu4c/source/test/perf/unisetperf/draft/trieset.cpp
@@ -108,9 +108,9 @@ class TrieSet : public UObject, public UnicodeContainable {
UBool contains(UChar32 c) const override {
if (static_cast(c) <= 0xff) {
- return static_cast(latin1[c]);
+ return latin1[c];
} else if (static_cast(c) < 0xffff) {
- return static_cast(UTRIE_GET8_FROM_LEAD(&trie, c));
+ return UTRIE_GET8_FROM_LEAD(&trie, c);
} else {
return restSet->contains(c);
}
diff --git a/icu4c/source/tools/genrb/parse.cpp b/icu4c/source/tools/genrb/parse.cpp
index f0bf9e79a0b4..f487241cc189 100644
--- a/icu4c/source/tools/genrb/parse.cpp
+++ b/icu4c/source/tools/genrb/parse.cpp
@@ -2137,7 +2137,7 @@ void initParser()
}
static inline UBool isTable(enum EResourceType type) {
- return static_cast(type == RESTYPE_TABLE || type == RESTYPE_TABLE_NO_FALLBACK);
+ return type == RESTYPE_TABLE || type == RESTYPE_TABLE_NO_FALLBACK;
}
static enum EResourceType
diff --git a/icu4c/source/tools/genrb/rle.c b/icu4c/source/tools/genrb/rle.c
index 0025be207e94..68427764aca3 100644
--- a/icu4c/source/tools/genrb/rle.c
+++ b/icu4c/source/tools/genrb/rle.c
@@ -162,12 +162,12 @@ usArrayToRLEString(const uint16_t* src,int32_t srcLen,uint16_t* buffer, int32_t
if (s == runValue && runLength < 0xFFFF){
++runLength;
}else {
- buffer = encodeRunShort(buffer,bufLimit, (uint16_t)runValue, runLength,status);
+ buffer = encodeRunShort(buffer, bufLimit, runValue, runLength, status);
runValue = s;
runLength = 1;
}
}
- buffer= encodeRunShort(buffer,bufLimit,(uint16_t)runValue, runLength,status);
+ buffer = encodeRunShort(buffer, bufLimit, runValue, runLength, status);
}else{
*status = U_BUFFER_OVERFLOW_ERROR;
}
diff --git a/icu4c/source/tools/gensprep/store.c b/icu4c/source/tools/gensprep/store.c
index f0f4d7844be8..b2cf44d186b3 100644
--- a/icu4c/source/tools/gensprep/store.c
+++ b/icu4c/source/tools/gensprep/store.c
@@ -233,7 +233,7 @@ static int32_t U_CALLCONV hashEntry(const UHashTok parm) {
/* Callback for comparing two entries */
static UBool U_CALLCONV compareEntries(const UHashTok p1, const UHashTok p2) {
- return (UBool)(p1.integer != p2.integer);
+ return p1.integer != p2.integer;
}
diff --git a/icu4c/source/tools/icupkg/icupkg.cpp b/icu4c/source/tools/icupkg/icupkg.cpp
index 45663d413ac4..3da4af745786 100644
--- a/icu4c/source/tools/icupkg/icupkg.cpp
+++ b/icu4c/source/tools/icupkg/icupkg.cpp
@@ -253,7 +253,7 @@ isPackageName(const char *filename) {
int32_t len;
len = static_cast(strlen(filename)) - 4; /* -4: subtract the length of ".dat" */
- return static_cast(len > 0 && 0 == strcmp(filename + len, ".dat"));
+ return len > 0 && 0 == strcmp(filename + len, ".dat");
}
/*
This line is required by MinGW because it incorrectly globs the arguments.
diff --git a/icu4c/source/tools/makeconv/genmbcs.cpp b/icu4c/source/tools/makeconv/genmbcs.cpp
index 774cdc6045d1..788fd9f75fb0 100644
--- a/icu4c/source/tools/makeconv/genmbcs.cpp
+++ b/icu4c/source/tools/makeconv/genmbcs.cpp
@@ -559,7 +559,7 @@ MBCSIsValid(NewConverter *cnvData,
const uint8_t *bytes, int32_t length) {
MBCSData *mbcsData=(MBCSData *)cnvData;
- return (UBool)(1==ucm_countChars(&mbcsData->ucm->states, bytes, length));
+ return 1==ucm_countChars(&mbcsData->ucm->states, bytes, length);
}
U_CDECL_END
static UBool
@@ -970,7 +970,7 @@ MBCSAddTable(NewConverter *cnvData, UCMTable *table, UConverterStaticData *stati
* a sorted table, which makeconv generates when explicit precision
* indicators are used.
*/
- mbcsData->utf8Friendly=utf8Friendly=(UBool)((table->flagsType&UCM_FLAGS_EXPLICIT)!=0);
+ mbcsData->utf8Friendly = utf8Friendly = (table->flagsType & UCM_FLAGS_EXPLICIT) != 0;
if(utf8Friendly) {
mbcsData->utf8Max=MBCS_UTF8_MAX;
if(SMALL && maxCharLength>1) {
diff --git a/icu4c/source/tools/toolutil/package.cpp b/icu4c/source/tools/toolutil/package.cpp
index dd4814927833..e58c6648b647 100644
--- a/icu4c/source/tools/toolutil/package.cpp
+++ b/icu4c/source/tools/toolutil/package.cpp
@@ -1233,7 +1233,7 @@ UBool
Package::checkDependencies() {
isMissingItems=false;
enumDependencies(this, checkDependency);
- return static_cast(!isMissingItems);
+ return !isMissingItems;
}
void
diff --git a/icu4c/source/tools/toolutil/ucm.cpp b/icu4c/source/tools/toolutil/ucm.cpp
index 14d73ba5a152..923041a53f60 100644
--- a/icu4c/source/tools/toolutil/ucm.cpp
+++ b/icu4c/source/tools/toolutil/ucm.cpp
@@ -575,8 +575,8 @@ ucm_checkBaseExt(UCMStates *baseStates,
/* check */
result=
- checkBaseExtUnicode(baseStates, base, ext, (UBool)(moveTarget!=nullptr), intersectBase)|
- checkBaseExtBytes(baseStates, base, ext, (UBool)(moveTarget!=nullptr), intersectBase);
+ checkBaseExtUnicode(baseStates, base, ext, moveTarget != nullptr, intersectBase) |
+ checkBaseExtBytes(baseStates, base, ext, moveTarget != nullptr, intersectBase);
if(result&HAS_ERRORS) {
return false;
diff --git a/icu4c/source/tools/tzcode/localtime.c b/icu4c/source/tools/tzcode/localtime.c
index 8d84a92ddd2b..d6dd5bef2417 100644
--- a/icu4c/source/tools/tzcode/localtime.c
+++ b/icu4c/source/tools/tzcode/localtime.c
@@ -1535,7 +1535,7 @@ timesub(const time_t *const timep, const int_fast32_t offset,
ip = mon_lengths[isleap(y)];
for (tmp->tm_mon = 0; idays >= ip[tmp->tm_mon]; ++(tmp->tm_mon))
idays -= ip[tmp->tm_mon];
- tmp->tm_mday = (int) (idays + 1);
+ tmp->tm_mday = idays + 1;
tmp->tm_isdst = 0;
#ifdef TM_GMTOFF
tmp->TM_GMTOFF = offset;
diff --git a/icu4j/APIChangeReport.html b/icu4j/APIChangeReport.html
index b136de45e90c..67bc10b619f6 100644
--- a/icu4j/APIChangeReport.html
+++ b/icu4j/APIChangeReport.html
@@ -4,286 +4,224 @@
-ICU4J API Comparison: ICU4J 74 with ICU4J 75
+ICU4J API Comparison: ICU4J 75 with ICU4J 76
-ICU4J API Comparison: ICU4J 74 with ICU4J 75
+ICU4J API Comparison: ICU4J 75 with ICU4J 76
-Removed from ICU4J 74
+Removed from ICU4J 75
(no API removed)
-Deprecated or Obsoleted in ICU4J 75
+Deprecated or Obsoleted in ICU4J 76
(no API obsoleted)
-Changed in ICU4J 75 (old, new)
+Changed in ICU4J 76 (old, new)
(no API changed)
-Promoted to stable in ICU4J 75
+Promoted to stable in ICU4J 76
-Package com.ibm.icu.text
-
-- (stable) public interface PersonName
-- (stable) public class PersonNameFormatter
-- (stable) public static class PersonNameFormatter.Builder
-- (stable) public class SimplePersonName
-- (stable) public static class SimplePersonName.Builder
-- (stable) public static enum PersonName.FieldModifier
-- (stable) public static enum PersonName.NameField
-- (stable) public static enum PersonName.PreferredOrder
-- (stable) public static enum PersonNameFormatter.DisplayOrder
-- (stable) public static enum PersonNameFormatter.Formality
-- (stable) public static enum PersonNameFormatter.Length
-- (stable) public static enum PersonNameFormatter.Usage
-PersonName.FieldModifier
+Package com.ibm.icu.lang
-- (stable) public static PersonName.FieldModifier forString(java.lang.String)
-- (stable) public java.lang.String toString()
-- (stable) public static final PersonName.FieldModifier ALL_CAPS
-- (stable) public static final PersonName.FieldModifier CORE
-- (stable) public static final PersonName.FieldModifier INFORMAL
-- (stable) public static final PersonName.FieldModifier INITIAL
-- (stable) public static final PersonName.FieldModifier INITIAL_CAP
-- (stable) public static final PersonName.FieldModifier MONOGRAM
-- (stable) public static final PersonName.FieldModifier PREFIX
-
-PersonName.NameField
-
-- (stable) public java.lang.String toString()
-- (stable) public static final PersonName.NameField CREDENTIALS
-- (stable) public static final PersonName.NameField GENERATION
-- (stable) public static final PersonName.NameField GIVEN
-- (stable) public static final PersonName.NameField GIVEN2
-- (stable) public static final PersonName.NameField SURNAME
-- (stable) public static final PersonName.NameField SURNAME2
-- (stable) public static final PersonName.NameField TITLE
-
-PersonName.PreferredOrder
-
-- (stable) public static final PersonName.PreferredOrder DEFAULT
-- (stable) public static final PersonName.PreferredOrder GIVEN_FIRST
-- (stable) public static final PersonName.PreferredOrder SURNAME_FIRST
-
-PersonNameFormatter.DisplayOrder
+UProperty
-- (stable) public static final PersonNameFormatter.DisplayOrder DEFAULT
-- (stable) public static final PersonNameFormatter.DisplayOrder SORTING
+- (stable) public static final int IDS_UNARY_OPERATOR
+- (stable) public static final int ID_COMPAT_MATH_CONTINUE
+- (stable) public static final int ID_COMPAT_MATH_START
-PersonNameFormatter.Formality
-
-- (stable) public static final PersonNameFormatter.Formality FORMAL
-- (stable) public static final PersonNameFormatter.Formality INFORMAL
-PersonNameFormatter.Length
+
+Package com.ibm.icu.number
-- (stable) public static final PersonNameFormatter.Length LONG
-- (stable) public static final PersonNameFormatter.Length MEDIUM
-- (stable) public static final PersonNameFormatter.Length SHORT
-
-PersonNameFormatter.Usage
+LocalizedNumberFormatter
-- (stable) public static final PersonNameFormatter.Usage ADDRESSING
-- (stable) public static final PersonNameFormatter.Usage MONOGRAM
-- (stable) public static final PersonNameFormatter.Usage REFERRING
+- (stable) public UnlocalizedNumberFormatter withoutLocale()
-UnicodeSet
+LocalizedNumberRangeFormatter
-- (stable) public static final int SIMPLE_CASE_INSENSITIVE
+- (stable) public UnlocalizedNumberRangeFormatter withoutLocale()
-Package com.ibm.icu.util
+Package com.ibm.icu.text
-MeasureUnit
+Normalizer2
-- (stable) public static final MeasureUnit BEAUFORT
-
+- (stable) public static Normalizer2 getNFKCSimpleCasefoldInstance()
-
-
-
-Added in ICU4J 75
-
-Package com.ibm.icu.lang
-
-- (draft) public static enum UCharacter.IdentifierStatus
-- (draft) public static enum UCharacter.IdentifierType
-UCharacter
+PersonName.FieldModifier
-- (draft) public static final int getIdentifierTypes(int, java.util.EnumSet<UCharacter.IdentifierType>)
-- (draft) public static final boolean hasIdentifierType(int, UCharacter.IdentifierType)
+- (stable) public static final PersonName.FieldModifier GENITIVE
+- (stable) public static final PersonName.FieldModifier VOCATIVE
-UCharacter.IdentifierStatus
+PersonNameFormatter.DisplayOrder
-- (draft) public static final UCharacter.IdentifierStatus ALLOWED
-- (draft) public static final UCharacter.IdentifierStatus RESTRICTED
+- (stable) public static final PersonNameFormatter.DisplayOrder FORCE_GIVEN_FIRST
+- (stable) public static final PersonNameFormatter.DisplayOrder FORCE_SURNAME_FIRST
-UCharacter.IdentifierType
+PersonNameFormatter.Formality
-- (draft) public static final UCharacter.IdentifierType DEFAULT_IGNORABLE
-- (draft) public static final UCharacter.IdentifierType DEPRECATED
-- (draft) public static final UCharacter.IdentifierType EXCLUSION
-- (draft) public static final UCharacter.IdentifierType INCLUSION
-- (draft) public static final UCharacter.IdentifierType LIMITED_USE
-- (draft) public static final UCharacter.IdentifierType NOT_CHARACTER
-- (draft) public static final UCharacter.IdentifierType NOT_NFKC
-- (draft) public static final UCharacter.IdentifierType NOT_XID
-- (draft) public static final UCharacter.IdentifierType OBSOLETE
-- (draft) public static final UCharacter.IdentifierType RECOMMENDED
-- (draft) public static final UCharacter.IdentifierType TECHNICAL
-- (draft) public static final UCharacter.IdentifierType UNCOMMON_USE
+- (stable) public static final PersonNameFormatter.Formality DEFAULT
-UProperty
+PersonNameFormatter.Length
-- (draft) public static final int IDENTIFIER_STATUS
-- (draft) public static final int IDENTIFIER_TYPE
+- (stable) public static final PersonNameFormatter.Length DEFAULT
-UScript
+SpoofChecker
-- (stable) public static final int ARABIC_NASTALIQ
+- (stable) public int areConfusable(int, java.lang.CharSequence, java.lang.CharSequence)
+- (stable) public java.lang.String getBidiSkeleton(int, java.lang.CharSequence)
-Package com.ibm.icu.message2
-
-MFDataModel.Attribute
-
-- (draft) public final java.lang.String name
-- (draft) public final MFDataModel.LiteralOrVariableRef value
-
-MFDataModel.CatchallKey
-
-- (draft) public MFDataModel.CatchallKey()
-
-MFDataModel.FunctionAnnotation
-
-- (draft) public final java.lang.String name
-- (draft) public final java.util.Map<java.lang.String, MFDataModel.Option> options
-
-MFDataModel.FunctionExpression
-
-- (draft) public final MFDataModel.FunctionAnnotation annotation
-- (draft) public final java.util.List<MFDataModel.Attribute> attributes
-
-MFDataModel.InputDeclaration
-
-- (draft) public final java.lang.String name
-- (draft) public final MFDataModel.VariableExpression value
-
-MFDataModel.Literal
+Package com.ibm.icu.util
-- (draft) public final java.lang.String value
-
-MFDataModel.LiteralExpression
+Calendar
-- (draft) public final MFDataModel.Annotation annotation
-- (draft) public final MFDataModel.Literal arg
-- (draft) public final java.util.List<MFDataModel.Attribute> attributes
+- (stable) public static final int ORDINAL_MONTH
+- (stable) public java.lang.String getTemporalMonthCode()
+- (stable) public boolean inTemporalLeapYear()
+- (stable) public void setTemporalMonthCode(java.lang.String)
-MFDataModel.LocalDeclaration
+ChineseCalendar
-- (draft) public final java.lang.String name
-- (draft) public final MFDataModel.Expression value
+- (stable) public java.lang.String getTemporalMonthCode()
+- (stable) public boolean inTemporalLeapYear()
+- (stable) public void setTemporalMonthCode(java.lang.String)
-MFDataModel.Markup
+HebrewCalendar
-- (draft) public final java.util.List<MFDataModel.Attribute> attributes
-- (draft) public final MFDataModel.Markup.Kind kind
-- (draft) public final java.lang.String name
-- (draft) public final java.util.Map<java.lang.String, MFDataModel.Option> options
+- (stable) public java.lang.String getTemporalMonthCode()
+- (stable) public boolean inTemporalLeapYear()
+- (stable) public void setTemporalMonthCode(java.lang.String)
-MFDataModel.Option
+IslamicCalendar
-- (draft) public final java.lang.String name
-- (draft) public final MFDataModel.LiteralOrVariableRef value
+- (stable) public boolean inTemporalLeapYear()
-MFDataModel.Pattern
+MeasureUnit
-- (draft) public final java.util.List<MFDataModel.PatternPart> parts
+- (stable) public static final MeasureUnit GASOLINE_ENERGY_DENSITY
-MFDataModel.PatternMessage
+TimeZone
-- (draft) public final java.util.List<MFDataModel.Declaration> declarations
-- (draft) public final MFDataModel.Pattern pattern
+- (stable) public static java.lang.String getIanaID(java.lang.String)
-MFDataModel.SelectMessage
-
-- (draft) public final java.util.List<MFDataModel.Declaration> declarations
-- (draft) public final java.util.List<MFDataModel.Expression> selectors
-- (draft) public final java.util.List<MFDataModel.Variant> variants
-MFDataModel.StringPart
+
+
+
+Added in ICU4J 76
+
+Package com.ibm.icu.lang
-- (draft) public final java.lang.String value
+- (draft) public static enum UCharacter.IndicConjunctBreak
+UCharacter.IndicConjunctBreak
+
+- (draft) public static final UCharacter.IndicConjunctBreak CONSONANT
+- (draft) public static final UCharacter.IndicConjunctBreak EXTEND
+- (draft) public static final UCharacter.IndicConjunctBreak LINKER
+- (draft) public static final UCharacter.IndicConjunctBreak NONE
+
+UCharacter.IndicSyllabicCategory
+
+- (stable) public static final int REORDERING_KILLER
+
+UCharacter.JoiningGroup
+
+- (stable) public static final int KASHMIRI_YEH
+
+UCharacter.UnicodeBlock
+
+- (stable) public static final UCharacter.UnicodeBlock EGYPTIAN_HIEROGLYPHS_EXTENDED_A
+- (stable) public static final int EGYPTIAN_HIEROGLYPHS_EXTENDED_A_ID
+- (stable) public static final UCharacter.UnicodeBlock GARAY
+- (stable) public static final int GARAY_ID
+- (stable) public static final UCharacter.UnicodeBlock GURUNG_KHEMA
+- (stable) public static final int GURUNG_KHEMA_ID
+- (stable) public static final UCharacter.UnicodeBlock KIRAT_RAI
+- (stable) public static final int KIRAT_RAI_ID
+- (stable) public static final UCharacter.UnicodeBlock MYANMAR_EXTENDED_C
+- (stable) public static final int MYANMAR_EXTENDED_C_ID
+- (stable) public static final UCharacter.UnicodeBlock OL_ONAL
+- (stable) public static final int OL_ONAL_ID
+- (stable) public static final UCharacter.UnicodeBlock SUNUWAR
+- (stable) public static final int SUNUWAR_ID
+- (stable) public static final UCharacter.UnicodeBlock SYMBOLS_FOR_LEGACY_COMPUTING_SUPPLEMENT
+- (stable) public static final int SYMBOLS_FOR_LEGACY_COMPUTING_SUPPLEMENT_ID
+- (stable) public static final UCharacter.UnicodeBlock TODHRI
+- (stable) public static final int TODHRI_ID
+- (stable) public static final UCharacter.UnicodeBlock TULU_TIGALARI
+- (stable) public static final int TULU_TIGALARI_ID
-MFDataModel.UnsupportedAnnotation
+UProperty
-- (draft) public final java.lang.String source
+- (draft) public static final int INDIC_CONJUNCT_BREAK
+- (draft) public static final int MODIFIER_COMBINING_MARK
-MFDataModel.UnsupportedExpression
+UScript
-- (draft) public final MFDataModel.UnsupportedAnnotation annotation
-- (draft) public final java.util.List<MFDataModel.Attribute> attributes
+- (stable) public static final int GARAY
+- (stable) public static final int GURUNG_KHEMA
+- (stable) public static final int KIRAT_RAI
+- (stable) public static final int OL_ONAL
+- (stable) public static final int SUNUWAR
+- (stable) public static final int TODHRI
+- (stable) public static final int TULU_TIGALARI
-MFDataModel.UnsupportedStatement
-
-- (draft) public final java.lang.String body
-- (draft) public final java.util.List<MFDataModel.Expression> expressions
-- (draft) public final java.lang.String keyword
-MFDataModel.VariableExpression
+
+Package com.ibm.icu.text
-- (draft) public final MFDataModel.Annotation annotation
-- (draft) public final MFDataModel.VariableRef arg
-- (draft) public final java.util.List<MFDataModel.Attribute> attributes
-
-MFDataModel.VariableRef
+DateFormat
-- (draft) public final java.lang.String name
+- (draft) public final java.lang.String format(java.time.temporal.Temporal)
+- (draft) public java.lang.StringBuffer format(java.time.temporal.Temporal, java.lang.StringBuffer, java.text.FieldPosition)
-MFDataModel.Variant
+DateIntervalFormat
-- (draft) public final java.util.List<MFDataModel.LiteralOrCatchallKey> keys
-- (draft) public final MFDataModel.Pattern value
+- (draft) public final java.lang.StringBuffer format(java.time.temporal.Temporal, java.time.temporal.Temporal, java.lang.StringBuffer, java.text.FieldPosition)
+- (draft) public DateIntervalFormat.FormattedDateInterval formatToValue(java.time.temporal.Temporal, java.time.temporal.Temporal)
-MFParseException
+RelativeDateTimeFormatter.RelativeUnit
-- (draft) public MFParseException(java.lang.String, int)
-- (draft) public java.lang.String getMessage()
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit FRIDAYS
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit MONDAYS
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit QUARTERS
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit SATURDAYS
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit SUNDAYS
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit THURSDAYS
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit TUESDAYS
+- (draft) public static final RelativeDateTimeFormatter.RelativeUnit WEDNESDAYS
-MFSerializer
+UnicodeSet
-- (draft) public MFSerializer()
+- (draft) public java.util.stream.IntStream codePointStream()
+- (draft) public java.lang.Iterable<java.lang.Integer> codePoints()
+- (draft) public java.util.stream.Stream<UnicodeSet.EntryRange> rangeStream()
+- (draft) public java.util.stream.Stream<java.lang.String> stream()
+- (draft) public java.util.stream.Stream<java.lang.String> stringStream()
-Package com.ibm.icu.number
-
-LocalizedNumberFormatter
+Package com.ibm.icu.util
-- (draft) public UnlocalizedNumberFormatter withoutLocale()
-
-LocalizedNumberRangeFormatter
+MeasureUnit
-- (draft) public UnlocalizedNumberRangeFormatter withoutLocale()
+- (draft) public static final MeasureUnit LIGHT_SPEED
+- (draft) public static final MeasureUnit NIGHT
+- (draft) public static final MeasureUnit PORTION_PER_1E9
-
-
-Package com.ibm.icu.util
-
-MeasureUnit.MeasurePrefix
+VersionInfo
-- (draft) public static final MeasureUnit.MeasurePrefix QUECTO
-- (draft) public static final MeasureUnit.MeasurePrefix QUETTA
-- (draft) public static final MeasureUnit.MeasurePrefix RONNA
-- (draft) public static final MeasureUnit.MeasurePrefix RONTO
+- (stable) public static final VersionInfo UNICODE_16_0
-Contents generated by ReportAPI tool on Mon Mar 25 13:11:50 EDT 2024
© 2024 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html
+Contents generated by ReportAPI tool on Wed Sep 18 16:18:21 PDT 2024
© 2024 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html