]> granicus.if.org Git - icu/commitdiff
ICU-10966 Fix NumberFormat::createInstance to return U_MISSING_RESOURCE_ERROR when...
authorTravis Keep <keep94@gmail.com>
Tue, 15 Jul 2014 00:10:52 +0000 (00:10 +0000)
committerTravis Keep <keep94@gmail.com>
Tue, 15 Jul 2014 00:10:52 +0000 (00:10 +0000)
X-SVN-Rev: 36026

icu4c/source/i18n/numfmt.cpp

index efc1211c98875de6a57bdc1e56070d6ee4e856b1..ac3bc559da4d31635a36984ae2b7c14ce9bc5892 100644 (file)
@@ -1402,17 +1402,7 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
     UnicodeString pattern;
     LocalUResourceBundlePointer ownedResource(ures_open(NULL, desiredLocale.getName(), &status));
     if (U_FAILURE(status)) {
-        // We don't appear to have resource data available -- use the last-resort data
-        status = U_USING_FALLBACK_WARNING;
-        // When the data is unavailable, and locale isn't passed in, last resort data is used.
-        symbolsToAdopt.adoptInstead(new DecimalFormatSymbols(status));
-        if (symbolsToAdopt.isNull()) {
-            status = U_MEMORY_ALLOCATION_ERROR;
-            return NULL;
-        }
-
-        // Creates a DecimalFormat instance with the last resort number patterns.
-        pattern.setTo(TRUE, gLastResortNumberPatterns[style], -1);
+        return NULL;
     }
     else {
         // Loads the decimal symbols of the desired locale.