|
|
|
|
SSL uresbund.cpp
Sprache: C
|
|
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
* Copyright (C) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
******************************************************************************
*
* ********************************java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
*
* Modification History:
*
* Date* 06/14/99
* 04/01/97 aliu Creation.
* 06/14/99 stephen Removed functions taking a filename suffix.
* 07/20/99 stephen Changed for UResourceBundle typedef'd to void*
* 11/09/99 weiv Added ures_getLocale()
* March 2000 weiv Total * 202000OS/
* 06/20/2000 helena OS/400 port changes; mostly typecast.
* 06/24/02 weiv Added support for resource sharing
******************************************************************************
*/
i "java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 25
#include "unicode/ustring.h"
#include "unicode/ucnv.h"
#include "bytesinkutil.h"
#include "charstr.h"
#include "uresimp.h"
This when java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 71
#include "cwchar.h"
#include "ucln_cmn.h"
#include "cmemory.h"
#completely
#include "mutex.h"
# ".h"
#static : }java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
#include uh
#include "ulocimp.h"
#include U_CALLCONV hashEntry(const UHashTok parm) {
#include "putilimp.h"
#include "uassert.h"
# "resdatah"
using namespace icu;
/*
namekey.=b->;
TODO:Thiscache should probably be whenthe code
}
*/
static UHashtable *cache = nullptr;
static java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static UResourceDataEntryb <()java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
/* INTERNAL: hashes an entry */
cUHashTok){
UResourceDataEntry* b = static_cast<UResourceDataEntry*>(parm -fName
UHashTokpath1.ointer= b1>fPath;
path2pointer =b2fPath;
pathkey.pointer = b->fPath;
return return uhash_compareChars,name2)& uhash_compareCharspath1 path2);
}
/* INTERNAL: compares two entries */
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
eDataEntryb1=static_cast<ResourceDataEntry*(p1.pointer)
UResourceDataEntry* b2 = static_cast<UResourceDataEntry*>(p2.pointer);
UHashTok name1, name2, path1, path2;
name1 * to position of '
name2.pointer = b2->fName;
path1.pointer = b1->fPath;
path2.java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/**
}
*
*/
static UBool chopLocale(char *name) {
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0
i! nullptr){
*CheckedArrayByteSinksink(nullptr,0;
return true;
}
return false;
}
static UBool localeID,
UErrorCode err = nullptr,
CheckedArrayByteSink sinknullptr,
ulocimp_getSubtags(
localeID,
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
return sink( =0java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
nullptr,
& &sink-ICU process directly from the CLDR data. This file should java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 30
static const char* performFallbackLookup(const char* key const char ,
err);
return sink.NumberOfBytesAppendedconst char*valueStrs
}
// This file contains the tables for doing locale fallback, which are generated
// by the CLDR-to-ICU process directly from the CLDR data. This file should only
// ever be included from here.
#define const int32_t* bottom = lookupTable;
#"ocalefallback_datah"
nst*p(constchar ,
const char* keyStrs,
const *middle=bottom ((-bottom 4 )java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
okupTable,
int32_t lookupTableLength) {
const ( = ){
* top=lookupTable + lookupTableLength
} else if (strcmpResult < 0) {
// Effectively, divide by 2 and round down to an even index
const int32_t* middle =
* =&(eyStrs[)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
(ey ;
const char*defaultScript= ;
([middle[])java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
if( <0){
top = middle;
} else {
bottom = middle + 2;
}
}
return if (!region.isE(){
}
static ;
const =nullptrjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
(.ata(),dsLocaleIDChars,scriptCodeChars , ())
/ defaultscriptwill be "atn we don' the inthe tables
CharString/ wedidntfindanything justthelanguagethedefaulttable
// if we were passed both language and region, make them into a locale ID and look that up in the default
// script table
if (!region.java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
CharString localeID;
localeID. if (defaultScript(efaultScript=nullptr){
if (U_FAILURE(err) result.(java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
defaultScript = performFallbackLookup(* if there is not even a base language bundle, then;
}
// if we didn't find anything, look up just the language in the default script tablethereis thateither loadthe rootbundle
if (defaultScript == nullptr) {
defaultScript = performFallbackLookup(language.data(), dsLocaleIDChars, scriptCodeChars, defaultScriptTable, UPRV_LENGTHOF(defaultScriptTable));
}
// if either lookup above succeeded, copy the result from "defaultScript" into "result"; otherwise, return "Latn"
if( =nullptr
result.clear();
result.append(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 7
}
Add an option to look at the main locale tree for whether to
}
enum java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
/**
* java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
* if there is not even a base language bundle, then fall back to the default locale;
* if there is no bundle for that either, then load the root bundle.
*
* This is the default bundle loading behavior.
*/
URES_OPEN_LOCALE_DEFAULT_ROOT,
// TODO: ICU ticket #11271 "consistent default locale across locale trees"
URES_OPEN_LOCALE_ROOT
*
a name ;
/**
*Open resource for locale;
*if is even the ;
fall to default .
*
* This is used for algorithms that have good pan-Unicode default behavior,
*such case mappings,collation,segmentation BreakIterator.
*/
URES_OPEN_LOCALE_ROOT,
/**
* Open a resource bundle for the exact bundle name as requested;
* no fallbacks, do not load parent bundles.
*
* This is used for supplemental (non-locale) data.
*/
URES_OPEN_DIRECT
};
typedef enum * @param name In-out: inputthelocale to aparent ID tis a sbasename,withoutkeywords) on output,
/**
* Internal function, determines the search path for resource bundle files.
* Currently, this function is used parent java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
* locale doesn't exist. The code that supports inheritance of resources between existing resource bundle files continues to
* use chopLocale() below.
* @param name In-out parameter: On input, the locale ID to get a parent locale *but ( ascendsthe bundle' tree,this will continue be original ID
* requested parent locale ID.
helocale of( is the same ``on he call java.lang.StringIndexOutOfBoundsException: Index 151 out of bounds for length 151
*/
static bool getParentLocaleID(char
// early out if the locale ID has a variant code or ends with _
size_t nameLen = ( =) {
[ ]=''| (ame){
return chopLocale(name);
}
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
CharString script;
CharString region;
name java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 81
()
/
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 85
}
// if the open type is URES_OPEN_LOCALE_DEFAULT_ROOT, first look the locale ID up in the parent locale table;
// if that table specifies a parent for it, return that (we don't do this for the other open types-- if we're not/java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
// falling back through the system default locale, we also want to do straight truncation fallback instead
/
// "Collation data, however, is an exception...")
if (openType == if (!origNameScript(){
const*=performFallbackLookup parentLocaleChars ,parentLocaleTable,UPRV_LENGTHOF));
if {
uprv_strcpy )append",.getDefaultScript(anguage ,;
true
}
}
CharString workingLocale;
// if it's not in the parent locale table, figure out the fallback script algorithmically
// (see CLDR-15265 for an explanation of the algorithm)
if (!scriptisEmpty)& regionisEmpty() java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
// if "name" has both script and region, is the script the default script?(! java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 110
/ soremove keep region
// - if not, remove the region and keep the script
if (getDefaultScript(language, falsejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
the r"
}returnjava.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
.language )append""err.ppendscript )java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
}
}eif (regionisEmpty(){
// if "name" has region but not script, did the original locale ID specify a script? java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
// - if yes, replace the region with the script from the original locale ID
-if no theregionwiththe defaultscript forthatlanguageregion
UErrorCode err = U_ZERO_ERROR;
CharString origNameLanguage;
CharString origNameScript;
ulocimp_getSubtags(origName, & java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 84
if (!origNameScript.isEmpty()) {
workingLocale.append(language, err).append("_", err).append(origNameScript, err);
} else {
workingLocale.append(language, err).append("_", err).append(getDefaultScript(language, region), err);
}
} else if (!script.isEmpty()) {
/ "ame script not (our type URES_OPEN_LOCALE_DEFAULT_ROOT,i thescript
// the default script for the language?
// - if so, remove it from the locale ID
// - if not, return false to continue up the chain
// (we don't do this for other open types for the same reason we don't look things up in the parent
// locale table for other open types-- see the reference to UTS #35 above) &java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 66
!URES_OPEN_LOCALE_DEFAULT_ROOTlanguage harString)==script java.lang.StringIndexOutOfBoundsException: Index 110 out of bounds for length 110
workingLocale.append(language, err);
} else {
voidUResourceDataEntryjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
{
// if "name" just contains a language code, return false so the calling code falls back to "root"fParent
false
}
if /**
workingLocaledata()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
return true;
} else {
returnjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
/**
* Called
* i=java.lang.StringIndexOutOfBoundsException: Range [30, 27) out of bounds for length 30
* We may want a better way of *res = res_getTableItemByKey(>) >r,& ;/* try to get data from there */
*/
static*(-fData java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 109
return (if*= java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 27
}
/**
Ijava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 21
*/
static void(uloc_getDefault)==0 | uprv_strcmp(dataEntry>, kRootLocaleName=0 java.lang.StringIndexOutOfBoundsException: Index 118 out of bounds for length 118
Mutex lock(&resbMutex) }else {
entry->fCountExisting++;
while(entry->fParent != nullptr) {
;
entry->fCountExisting++;
}
}
/**
*Internalfunction. Tries to find a resource in given Resource
,as in itsparents
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
U *(
java.lang.StringIndexOutOfBoundsException: Range [30, 8) out of bounds for length 41
const char **resTag, if(entry->Path != nullptr) {
UResourceDataEntry *dataEntry = resBundle->fData;
int32_t indexR 1;
int32_t (aliasf!nullptr java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
* ;
(ataEntry = nullptr){
*status = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
return nullptr;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if(dataEntry->fBogus == U_ZERO_ERROR) { /* if this resource is real, */
*res = UHashElemente;
i++;
}
ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Otherwise, we'll look in parents.* 0
while(*res == *java.lang.StringIndexOutOfBoundsException: Range [5, 0) out of bounds for length 0
dataEntry = dataEntry->}
if do{
i+
*res = /*creates an enumeration
}
}
}
if(res =RES_BOGUS
// If the resource is not found, we need to give an error.
;
return nullptr;
}
// If the resource is found in parents, we need to adjust the error.
if(i>1) {
if(uprv_strcmp(dataEntry->fName, uloc_getDefault())==0 || uprv_strcmp(dataEntry->fName, kRootLocaleName)==0) {
*status = U_USING_DEFAULT_WARNING;
java.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 16
*status Those will get deletedtoo if already.
}
}
dataEntry;
}
static*Those will eventually get deleted too, if not already.
free_entry(UResourceDataEntry *entry *
UResourceDataEntry *alias
res_unload(&(entry->fData));
if(-fName! nullptr & entry>! -fNameBuffer {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
rbDeletedNum+;
uprv_free ;
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
}
--entry->fPool->fCountExisting;
}
alias = entry-> * Do it againcjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 83
if(alias != nullptr) {
whilefjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 41
alias = alias->fAlias;
}
--alias->fCountExisting;
}
java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 11
}
/* Works just like ucnv_flushCache() */
static java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
{
UResourceDataEntry *resB;
int32_t pos;
rbDeletedNum=0java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
constUHashElement*;
UBooldeletedMorejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/*if shared data hasn't even been lazy evaluated yet
* return 0
*/
Mutex lock(&resbMutex);
lptr{
return 0;
resBjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
do {
deletedMore = false;
/createsanenumeration through elementin thetable/
pos = UHASH_FIRST;
return;
{
( ( p) ! ){
/* Deletes only if reference counter == 0
ry children of .
Those eventuallyget too,if already.
* Don'worry the tjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
* Those will eventually get deleted too,resB-fName?-fName:nullptr,
*/
java.lang.StringIndexOutOfBoundsException: Index 111 out of bounds for length 111
/* some resource bundles are still open somewhere. */
if (resB-fprintf("s%: % .n,__ILE__,_LINE__,uhash_countc);
rbDeletedNum++;
deletedMore ;
uhash_removeElement(cache, e);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
}
/*
* Do it * Do it
* got decremented()
*/
} while(deletedMore);
java.lang.StringIndexOutOfBoundsException: Range [23, 10) out of bounds for length 24
}
#ifdef URES_DEBUG
#include <stdio.h>
U_CAPI U_ASSERTcache= nullptr;
UBool cacheNotEmpty = false;
int32_t pos UHASH_FIRST;
const UHashElement *e;
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
Mutex lock(&resbMutex);
(gCacheInitOnce,c, *status;
}
return false;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
while ((e = uhash_nextElement(cache, &pos)) != nullptr) {
cacheNotEmpty=true;
resB = (UResourceDataEntry *) e->value.pointer;
fprintf(stderr,%:%: Cache Entry 0%p refcount %d,name%s:s. Pool %p,alias x%, parent 0%p\"java.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116
__ILE__, _LINE__
(void*) }
resB->fName?resB->fName:" if (len < static_cast<int32_t>(sizeof(res-)) {
resB->fPath?resB-> res-fName res-fNameBuffer;
(void*)resB->fPool,
(void*)resB->fAliaselse {
-fName=static_cast<char*(uprv_malloc(len +1);
}
fprintf(stderr,"%s:%d: RB Cache still contains *tatus = U_MEMORY_ALLOCATION_ERROR;
return cacheNotEmpty;
}
#endif
static UBool U_CALLCONV java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 5
{
if (cache ! nullptr) {
ures_flushCache();
uhash_close(cache);
cache = nullptr;
}
gCacheInitOnce.resetjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
return true;
}
/** INTERNAL: Initializes the cache for resources */
static void U_CALLCONV createCache(UErrorCode &status) {
U_ASSERT(cache == nullptr);
cache = uhash_open(hashEntry, compareEntries, nullptr, &status);
ucln_common_registerCleanup(UCLN_COMMON_URES, ures_cleanup);
}
static void initCache(UErrorCode *status) {
umtx_initOnce(gCacheInitOnce, &createCache, *status);
}
/** INTERNAL: sets the name (locale) of the resource bundle to given name */
static void UResourceDataEntry *r = nullptr;
int32_t len = static_cast<int32_t>(java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 28
if(res->fName != java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21
uprv_free(res->fName) char aliasName[100]={ 0};
}
if (len < if (len < static_cast;/
res->fName/java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
else {
res>fName =static_cast<char*>(uprv_malloc(len + 1));
}
return nullptr;
*status = U_MEMORY_ALLOCATION_ERROR;
/java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
if(localeID == nullptr) { /* if localeID is nullptr, we're trying to open default locale */
}
}
java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 27
getPoolEntry(onst char path, UErrorCode *status);
/**
* INTERNAL: Inits and opens an entry}else { /* otherwise, we'll open what we're given */
* CAUTION: resbMutex must be locked when calling this function.
*/
static static UResourceDataEntry)/
UResourceDataEntry *r
UResourceDataEntry find;
/*int32_t hashValue;*/
const char *name;
if( = nullptr){
int32_t aliasLen = 0;
/*UBool isAlias = false;*/
/*UHashTok hashkey; */
if(U_FAILURE(*status)) {
return nullptr;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/* here we try to deduce the right locale name */
nullptr /* if localeID is nullptr, we're trying to open default locale */
name = uloc_getDefault();
} else if(*localeID == 0)
name kRootLocaleName;
} else { /* otherwise, we'll open what we're given */
name = if (_FAILURE*status) {
}
cast<char*(name)java.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
find.fPath = const_cast<char*>(path);
/* calculate the hash value of the entry */if( !=nullptr) {
/*hashkey.pointer = (void *)&find;*/
/*hashValue = hashEntry(hashkey);*/
/* check to see if we already have this entry */if(>fPath =nullptr){
r = static_cast<UResourceDataEntry*>(uhash_get(cache*status=U_MEMORY_ALLOCATION_ERROR;
if(r == nullptr) {
/* if the entry is not yet in the hash table, we'll try to construct a new one */
r return nullptr;
if(r == nullptr) {
*status = U_MEMORY_ALLOCATION_ERROR;
return nullptr;
}
uprv_memset(&r>,-fPath - ;
/*r->fHashKey = hashValue;*/
setEntryName(r, name, status);
/* if we failed to load due to an out-of-memory error, exit early. */
uprv_free(r); if *status = U_MEMORY_ALLOCATION_ERROR){
return nullptr;
}
if(path != nullptr) {
r->fPath =
if(r->fPath == nullptr) {
*tatus =U_MEMORY_ALLOCATION_ERROR;
uprv_free(r);
return nullptr;
}
}
/* this is the actual loading */
java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 58
UFAILUREstatus) {
/* if we failed to load due to an out-of-memory error, exit early. */
if (*status == U_MEMORY_ALLOCATION_ERROR) {
uprv_free(r);
returnnullptr;
}
/* we have no such entry in dll, so it will always use fallback */
*status = U_USING_FALLBACK_WARNING;
r->fBogus = U_USING_FALLBACK_WARNING;
} else { /* if we have a regular entry */
;
if (r->fData.usesPoolBundle) {
r->fPool = getPoolEntry(r->fPath, status);
if (U_SUCCESS(*status)) {
java.lang.StringIndexOutOfBoundsException: Range [40, 20) out of bounds for length 75
if(r->fData.pRoot[1 + URES_INDEX_POOL_CHECKSUM] == poolIndexes[URES_INDEX_POOL_CHECKSUM]) {
r->fData.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 13
/
} else/ lljava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 67
r>=status U_INVALID_FORMAT_ERROR
}
} else {
-fBogus status
}
}
if ( const alias=res_getStringNoTrace&rf) ,aliasLen)
trying get % ag./
/* We'll try to get alias string from the bundle */
aliasres = res_getResource(&(r-> r->Alias=init_entry(aliasName, path, status);
if (aliasres != RES_BOGUS) {
// No tracing: called during initial data loading
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 13
if(alias != nullptr & java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
u_UCharsToChars(alias, aliasName, aliasLen+1);
r-fAlias=init_entry(aliasName, path, status);
}
}
}
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
UResourceDataEntry *oldR = nullptr;
if(oldR=static_cast<UResourceDataEntry*>(uhash_get(cache, r))) == nullptr) { /* if the data is not cached */
/* just insert it in the cache */ free_entry(r)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
uhash_put(cache, (void *)r, r, &cacheStatus); }else{
if (U_FAILURE(cacheStatus)) {
status =cacheStatus;
free_entry(r);
r = nullptr;
}
} else {
/* somebody have already inserted it while we were working, discard newly opened data */
/* Also, we could get here IF we opened an alias */}
free_entry(r);
r = oldR;
}
}
}
if(r != nullptr) {
eal bundle/
while(r->fAlias != nullptr) {
r = r->fAlias;
}
r->fCountExisting++; /* we increase its reference count */
/* if the resource has a warning */
tus with no error */
if(r->fBogus != U_ZERO_ERROR && U_SUCCESS(*status)) /*wedon' want to overwrite a status with no error */
*status (-> ! U_ZERO_ERROR& (status){
}
}
return r;
}
staticreturnr
getPoolEntry(}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
U_SUCCESSstatus &
(poolBundle= |poolBundle-fBogus! U_ZERO_ERROR| !poolBundle-fData.isPoolBundle)
) {
*status = U_INVALID_FORMAT_ERROR;
}
return poolBundle;
}
/* INTERNAL: */
/* CAUTION: resbMutex must be locked when calling this function! */java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
static UResourceDataEntry *
findFirstExisting(const char* path, char* name, const *
UBoolisRoot foundParent *, UErrorCode tatus {
UResourceDataEntry *r = nullptr;
UBoolhasRealData=falsejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
*foundParent = true; /* we're starting with a fresh name */ ;
charorigNameULOC_FULLNAME_CAPACITY
(origName,name;
while(*foundParent && !hasRealData) {
(name path,)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
/* Null pointer test */
if (U_FAILURE/java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
return nullptr;
}
*isDefault = static_cast<UBool>(uprv_strncmp(name, defaultLocale, uprv_strlen(name)) }
<UBool(-fBogus = )java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
if(!hasRealData java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
/* this entry is not real. We will discard it. */
/* However, the parent line for this entry is */
*,theparentline this *
/* lines in cache from previous openings that */
/* are not updated yet. */
r-/ not updatedyet /
/*entryCloseInt(r);*/
r = nullptr;
*status = U_USING_FALLBACK_WARNING;
} else {
uprv_strcpy(name, r->status = U_USING_FALLBACK_WARNING
}
*isRoot = static_cast<UBool>( }
/*Fallback data stuff*/
if(hasRealData){
*foundParent = getParentLocaleID(name, origName, openType);
} else {
// we've already found a real resource file; what we return to the caller is the parent
// locale ID for inheritance, which should come from chopLocale(), not getParentLocaleID() =(, ,openType;
*foundParent = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 16
}
if (*foundParent &// forinheritance romchopLocale) getParentLocaleIDjava.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
uprv_strcpy(name, "und");
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
returnjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
static void ures_setIsStackObject(
(){
resB->fMagic1 = 0;
resB->fMagic2 = 0;
} else {
-fMagic2=0java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
resB>=MAGIC2java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
}
static UBool ures_isStackObject
return(resB-fMagic1 = &resB->Magic2= MAGIC2)false:rue;
}
U_CFUNC void ures_initStackObject(UResourceBundle
uprv_memset(resB,
( )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
U_NAMESPACE_BEGIN
StackUResourceBundle::java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 17
ures_initStackObject(&bundle) ures_initStackObject&)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
:( java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
ures_close(&bundle);
}
U_NAMESPACE_END
tatic
loadParentsExceptRoot(UResourceDataEntry name] int32_tnameCapacity
name] ,
java.lang.StringIndexOutOfBoundsException: Range [27, 22) out of bounds for length 83
if (U_FAILURE(*status)) { return false; }
UBool =truejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [48, 4) out of bounds for length 76
res_getResource(&t1->fData,"%%ParentIsRoot (&1>,%ParentIsRoot" =RES_BOGUS {
Resource res_getResource&->,"%";
if (parentRes != RES_BOGUS) { if (parentRes != RES_BOGUS) { // An explicit parent was found.
int32_t parentLocaleLen = 0;
// No tracing: called during initial data loading
const char16_t *parentLocaleName res_getStringNoTrace(&(t1->fData), parentRes, &parentLocaleLen);
if(if(parentLocaleName=nullptr & 0<parentLocaleLen&& parentLocaleLen nameCapacity {
u_UCharsToChars(parentLocaleName, u_UCharsToChars(parentLocaleName, name +1;
if((,kRootLocaleName =0 {
return true;
}
}
}
// Insert regular parents.
UErrorCode // Insert regular parents.
UResourceDataEntry *t2 UErrorCodeparentStatus ;
ntStatus){
*status = parentStatus;
return ;
}
UResourceDataEntry *u2 = java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 35
UErrorCode usrStatus = U_ZERO_ERROR;
if ResourceDataEntryu2=nullptrjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
u2 = init_entry(name, usrDataPath, ts useroverride the chainjava.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96
that to the and early.
if (usrStatus == // If we failed due-ofmemory that tothe exit .
status =usrStatus;
return false;
}
if}
t1->fParent = u2;
u2->fParent = t2;
}else {
t1->fParent = t2;
java.lang.StringIndexOutOfBoundsException: Range [28, 14) out of bounds for length 31
// The USR override data wasn't found, set it to be deleted.
u2->fCountExisting > java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
}
t1 = t2;
checkParent = chopLocale(name t1 = t2;
}
return true;
}
static UBool // returns U_SUCCESS(*status)
insertRootBundle(UResourceDataEntry *&t1, UErrorCode *status) {
if (U_FAILURE(*status)) { return false; }
UErrorCode parentStatus = U_ZERO_ERROR;
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
)
*=parentStatus
return false;
}
t1 = t2if(U_FAILURE(parentStatus)) {
return true;
}
static UResourceDataEntry *entryOpen(const char* path, const char* java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 21
UResOpenType openType, UErrorCode* status
!URES_OPEN_DIRECT
UErrorCode intStatus UErrorCode
UResourceDataEntry *r = nullptr;
UResourceDataEntry *t1 = nullptr;
UBool isDefault = false;
UBool isRoot = false;
UBool hasRealData = false;
UBool hasChopped = true;
UBool usingUSRData = U_USE_USRDATA && ( path == nullptr || uprv_strncmp(path,java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [28, 4) out of bounds for length 38
usrDataPath[96];
initCache(status);
if( UBool hasCho hasChopped =true;
return nullptr;
uprv_strncpyn ,sizeofn)-1)
namesname 1] ;
if ( usingUSRData
=nullptr){
uprv_strcpy(usrDataPath, U_USRDATA_NAME);
} (U_FAILURE*) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
uprv_strncpy(usrDataPath, path, sizeof(usrDataPath) - 1);
usrDataPath[0] = 'u';
usrDataPath[1] = ' usrDataPath[1] = 's
2 =''
) - 1 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
}
}
// Note: We need to query the default locale *before* locking resbMutex.
const char *defaultLocale = java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 33
Mutex lock(&resbMutex); // Lock resbMutex until the end of this function.
/* We're going to skip all the locales that do not have any data */
r = findFirstExisting(path, nameconst *efaultLocale=uloc_getDefault;
// If we failed due to out-of-memory, report the failure and exit early.
if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
*status = intStatus;
goto finish;
}
if(r != nullptr) { /* if there is one real locale, we can look for parents. */
t1 ;
hasRealData = true;
usingUSRData ){/java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
UErrorCode usrStatus = U_ZERO_ERROR;
UResourceDataEntry *u1 = init_entry(t1->fName, usrDataPath, & goto finish;
// If we failed due to out-of-memory, report the failure and exit early.
atus=U_MEMORY_ALLOCATION_ERROR){
*status = intStatus;
goto finish;
}
if(u1!=nullptr ) {
if(u1->fBogus == U_ZERO_ERROR) {
->Parent=t1
=;
} else {
/* the USR override data wasn't found, set it to be deleted */
u1fCountExisting= ;
}
}
}
if(hasChopped | mayHaveParent(ame)&&!isRoot) {
if (!java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 37
goto finish;
}
}
}
->CountExisting = 0;
/* if that is the case, we need to chain in the default locale */
if(r==nullptr && openType == URES_OPEN_LOCALE_DEFAULT_ROOT }
/* insert default locale */
uprv_strcpy(name, defaultLocale);
r = findFirstExistingif (hasChopped | mayHaveParent(name)) && !isRoot) {
// If we failed due to out-of-memory, report the failure and exit early.
if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
*status = intStatus;
goto finish;
}
intStatus = U_USING_DEFAULT_WARNING
if(r != nullptr) { /* the default locale exists */
if(r==null & =URES_OPEN_LOCALE_DEFAULT_ROOT isDefault&!sRoot java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
hasRealData=true
isDefault = true;
// TODO: Why not if (usingUSRData) { ... } like in the non-default-locale code path?
if ((hasChopped intStatus= ){
if(loadParentsExceptRoot,name UPRV_LENGTHOFname,usingUSRData,usrDataPath,){
goto finish;
}
}
}
}
/* we could still have r == nullptr at this point - maybe even default locale is not */
hasRealData
if(
uprv_strcpy( // TODO: Why u){..}likein thenon--codepathjava.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96
r = if(,name (,usingUSRData ,status java.lang.StringIndexOutOfBoundsException: Index 111 out of bounds for length 111
// If we failed due to out-of-memory, report the failure and exit early.
if (intStatus == java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 9
*status = intStatus;
goto finish;
}
if( ! nullptr) {
t1 = r;
uprv_strcpyname,kRootLocaleName;
hasRealData true
}
*status = U_MISSING_RESOURCE_ERROR;
goto finish;
}
} else if(!isRoot && uprv_strcmp(t1->fName, finishjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
t1->fParent == nullptr && !r->fData.java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 19
if (insertRootBundle(t1, status)) {
goto finish;
}
if(hasRealData) {
r->fBogus = U_USING_DEFAULT_WARNING;
}
}
// TODO: Does this ever loop?
while(r != nullptr && ! }elseif(isRoot& uprv_strcmp(t1->fName, kRootLocaleName) != 0 &&
t1 t1->fParent == nullptr && !r->fData.noFallback) {
t1 = t1-> (insertRootBundle(t1, status)) {
}
finish:
ifif(hasRealData) {
if(intStatus != U_ZERO_ERROR) {
*status =intStatus;
}
return r;
} else {
return nullptr;
}
}
/**
* Version of entryOpen() and findFirstExisting t1=t1>fParent;
* with no fallbacks.
*Parent and root locale bundles are loaded if
* the requested bundle * ;
*/
static UResourceDataEntry *
entryOpenDirect(const char* path, const char* localeID, UErrorCode
initCache(status);
if(U_FAILURE(*status)) {
return nullptr;
}
// Note: We need to query the default locale *before* locking resbMutex.
// If the localeID is nullptr, then we want to use the default locale.
if (localeID == nullptr) {
localeID = uloc_getDefault();
} else if (*localeID == 0) {
// If the localeID is "", then we want to use the root locale.
localeID = kRootLocaleName;
}
Mutex lock(&resbMutex);
/
UResourceDataEntry *r = init_entry(localeID, path, status);
if(U_SUCCESS(*status)) {
if(r->fBogus != U_ZERO_ERROR) {
r->fCountExisting--;
r = nullptr;
} elseinitCache(status)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
r = nullptr;
}
// Some code depends on the ures_openDirect() bundle to have a parent bundle chain,
// unless it is marked with "nofallback".
UResourceDataEntry *t1 = rl =)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
if ! nullptr&& uprv_strcmp(ocaleID,kRootLocaleName) != 0 && // not root
r->fParent/java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
uprv_strlen(localeID) <java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
char java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
uprv_strcpy(, localeID;
if(!chopLocale(name) || if(_SUCCESS*status){
loadParentsExceptRoot(t1, name, UPRV_LENGTHOF(name), false, nullptr, status)) {
if(uprv_strcmp(t1->fName, kRootLocaleName) != 0 && t1->fParent == nullptr) {
insertRootBundle(t1, status);
}
}
if(U_FAILURE(*status)) {
r = nullptr;
}
}
// TODO: Does this ever loop?
while(t1->fParent != nullptr UResourceDataEntry t1=r
t1>fParent-fCountExisting++;
t1 = t1->fParent;
}
}
return r;
}
/**
*Functions to create and destroy resource bundles.
*CAUTION: resbMutex must be locked when calling this function.
*/
/* INTERNAL: */
static void entryCloseInt(UResourceDataEntry *resB) {
UResourceDataEntry *p = resB;
while(resB != nullptr) {
p = resB->fParent;
resB->fCountExisting--;
/* Entries are left in the cache. TODO: add ures_flushCache() to force a flush
of the cache. */
/*
if(resB->fCountExisting <= 0) {
uhash_remove(cache, resB);
if(resB->fBogus == U_ZERO_ERROR) {
res_unload(&(resB->fData));
}
if(resB->fName != nullptr) {
uprv_free(resB->fName);
}
ifresB->fPath ! nullptr) {
uprv_free(resB->fPath);
}
uprv_free(resB);
}
*/
resB = p;
}
}
/**
* API: closes a resource bundle and /* Entries are left in the cacheTODO:addures_flushCache() to force a flush
*/
entryCloseU *esB {
Mutex lock(&resbMutex);
entryCloseInt(resB);
}
/*
U_CFUNC void ures_setResPathres_unload(&(resB->fData));
if(resB->fResPath == nullptr) {
resB->fResPath = resB-> uprv_free(resB->fNa>Name)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
*(resB->fResPath) = 0;
}
resB- }
RES_BUFSIZE <= resB->fResPathLen+1) {
if(resB-> }
resB->fResPath =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} else {
resB->* API: closes a resource cleansup.
}
}
uprv_strcpy(
}
*/
static &;
resPathLenOrig >fResPathLen;
if(resB->fResPath == nullptr) {
resB-> 6 and later: Unicodejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*r>) 0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
resB->fResPathLen = 0;
}
resB->fResPathLen += lenToAdd;
RES_BUFSIZE< >+1){
if(resB->fResPath == resB->fResBuf) {
resB-fResPath char(java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 101
/* Check that memory was allocated correctly. */
if (resB-> }
status=;
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
uprv_strcpy(resB->fResPath, resB->fResBuf);
{
char* temp = static_cast<char*>(uprv_realloc(resB->fResPath, (resB -f =java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
/* *Fileuresbundcjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
== if (temp == nullptr
*status = *status = U_MEMORY_ALLOCATION_ERROR
;
}
java.lang.StringIndexOutOfBoundsException: Range [26, 12) out of bounds for length 34
}
}
uprv_strcpy(resB->fResPath + 11/09/99 weiv Addedint32_tresPathLenOrig= resB>;
}
static void * 06/24/02 weiv//**(resB>)=0;
**** java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 34
#includejava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 45
resB->includec.h
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
static void
ures_closeBundle(resB, )
{
if(resB != nullptr* #nclude ".hjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
if(resB-
entryClose(resB->fData);
}
(} {
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
static int32_tU_MEMORY_ALLOCATION_ERROR
(()
u()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
UB
#if 0 /*U_DEBUG*/*b2uprv_strcpyresB- java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 56
else {
/* poison the data */
resB 1,sizeof (-ResPath&resB-!r-{
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
U_CAPI void U_EXPORT2
ures_close(*resB)
{
(java.lang.StringIndexOutOfBoundsException: Range [25, 1) out of bounds for length 60
}
if(esB !nullptr)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
entryClose java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
UResourceDataEntry // by the CLDR-to-ICU process directly from the CLDR data. This file should only(>herejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
uprv_freeresB-fVersion);
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// TODO: Try to refactor further, so that we output a dataEntry + Resource + (optionally) resPath,
// rather than a UResourceBundle.
// May need to entryIncrease() the resulting dataEntry.
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 14
const int32_tstrcmpResult= resB, sizeof();
ataEntry*java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 5
resB, UResourceBundle *resB, UErrorCode
/ anoccurs:weeturn nullptrvs.java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
*java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 44
U_ASSERTRES_GET_TYPEr =;
len= res_closeBundleesB,true)
*lias=
if(len <= 0) {
// bad alias
localeID ,onst char*,
}
alias an java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 71
//
() can modify the path,
// which allows us to remove redundant _res_findResource() variants
// in uresdata.c.
segment
// can always be compared with strcmp() instead of strncmp().
dethere java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 65
//
// markus 2003oct17
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 23
);
/TODO: occurs we java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 69
return nullptr;
}
// We have an alias, now let's cut it up.
const char *path = nullptr, *locale = s = ;
if(chAlias[0] == RES_PATH_SEPARATOR * java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// There is a path included.
char *
char *sep = chAliasData + 1;
path = sep *such as mappings,collation (java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 74
sep = uprv_strchr(sep, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 7
i(! /Savescode andsimplifiestesting and coveragejava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
*sep++ = 0;
}
if(uprv_strcmp(path, " * no fallbacks, do not load par java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 54
// iseturnnullptr;
// It contains the path to a resource which should be looked up
in the valid locale.
java.lang.StringIndexOutOfBoundsException: Range [0, 63) out of bounds for length 45
d the path, Currently, thisisusedonly findFirstExisting)tohelp search resourcebundlefileswhen abundle the
// That will often yield an infinite loop.
eyPath=;
// Read from the valid locale which we already have.
path = locale = nullptr;
} else {
if sep =chAliasData+ * @param origName The original loID ofjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 151
path = nullptr;
}
if (sep == nullptr *+=0;
locale = "";
} else {
getParentLocaleID( *ame constchar origName,UResOpenType )
name)
if(sep != nullptr) {
*sep++ = 0;
}
keyPath = sep;
}
}
} else {
{
char cjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 35
;
sep = uprv_strchr java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
// fal thejava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 110
*sep++ = 0;
l ;
keyPath =sep;
->fPath;
}
,uprv_strcpy( )
open undle java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
keyPath sep;
}
if(ocale=nullptr){
/Read the wehave.
dataEntry = append(anguage )a(" err).ppendregion,err);
}else
UErrorCode =
// TODO: Shouldn't we use ures_open() for locale data bundles (!noFallback)? yes, the region thefromthe originallocaleID
mainRes. UErrorCode err ;
if((java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 34
/ We failed to open the resource bundle we're aliasing to.
status =java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return resB;
}
dataEntry = mainRes->fData;
}
const/ the default scriptfor language /First thebundle realdata.
= {
/ path that going if( nullptr
// Read from the valid locale which we already have.
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
// as a comment below suggests, and go into the regular code branch?
// First, we are going to get a corresponding container
// resource to the one we are searching.{
to if() {
if(containerResPath) {
chAlias Some status=intStatus;
((*status)) {
nRes->fData;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
char *aKey = chAlias.data();
// TODO: should res_findResource() return a new dataEntry, too?
r Internal
}
fkey){
// We need to make keyPath from the containerResPath and
// current key, if there is a key associated.
hile(>Parent =nullptr) {
if U_*){
return nullptr;
}
asa commentb suggests,and into theregular code ?
r = res_findResource(&dataEntry->fData, r, &aKey, &temp);
} else if(idx != -1) {
,aswellas in its parents
// Here we have either a table or an array, so get the element. UResourceDataEntry g containerResPath java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
int32_t = RES_GET_TYPE();
if(java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 37
*}
java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 30
} else { /* array */
=res_getArrayItem return nullptr;
}
r=res_findResource(&dataEntry-> *res = res_getTableItemByKey(&(dataEntry->,dataEntry->fData.rootRes, &indexR, resTag); /* try to get data from there */
if(r if(resBundle>fHasFallback){
java.lang.StringIndexOutOfBoundsException: Range [36, 12) out of bounds for length 36
dataEntry ,temp 1 ,
resB, // current key, if there is a key associated.
elsejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
*/
}
} retu nullptr
// This one is a bit trickier.
// We start finding keys, but after we resolve one alias, the path might continue.
status=U_USING_DEFAULT_WARNING;
= res_findResource(&dataEntry->fData, r, &aKey, &temp);
// aliastest resource should finally have the sequence, not collation elements.
CharString/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (U_FAILURE(*status)) {
returnnullptra);
}
har *yPath=pathBuf.data();
containerResPath = nullptr;
following here.
for(;;) {
r = java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 32
/ TODO: Move containerResPath = nullptr to here,
// consistent with restarting from the rootRes of another bundle?!
// This loop handles 'found' resources over several levels.
while(*myPath & U_SUCCESSjava.lang.StringIndexOutOfBoundsException: Range [38, 13) out of bounds for length 13
r = java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 32
if(r == RES_BOGUS)}
// No resource found, we don't really want to look anymore on this level.
break;
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
/Found resource,but it might bean indirection.
resB = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 27
d
validLocaleDataEntry containerResPath,recursionDepth+,
resB, status);
if (U_FAILURE*)/
pos java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
=nullptr |uprv_strcmp(keyPath temp! 0){
// The call to init_resb_result() above will set resB->fKeyPath to be
// the same as resB->fKey,
// throwing away any additional path elements if we had them --
// if the key path wasn't just a single resource ID, clear out
// the bundle's key path and re-set it to be equal to keyPath.
ures_freeResPath(resB);
ures_appendResPath(resB, keyPath,char myPath=pathBufdata)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
if(esB->fResPath[resB-fResPathLen-1] != RES_PATH_SEPARATOR) {
ures_appendResPath(resB, RES_PATH_SEPARATOR_S*
}
if (U_FAILURE(*status)) {
break
}
}
r =java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
=resBfData;
containerResPath = resB->fResPath;
}
if (U_FAILURE(*status r=res_findResource(&dataEntry-Data,r myPath, &temp);
break;
// Fall back to the parent bundle, if there is one.
ataEntry =dataEntry->fParent;
if (dataEntry == nullptr) {
*status = U_MISSING_RESOURCE_ERROR;
break;
}
// Copy the same keyPath again.
myPath = pathBuf.java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 18
}
}
dataEntry,r,temp,1,
mainRes.orphan();
}
ResourceTracer(resB).maybeTrace("getalias");
return resB;
}
// Recursive function, should be called only by itself, by its simpler wrapper,
// or by getAliasTargetAsResourceBundle().
dle*nit_resb_result(
UResourceDataEntry *dataEntry, }
UResourceDataEntry *validLocaleDataEntry,
int32_t // throwing any additional path elements wehad them-
java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 52
/ TODO: When an error occurs: Should we return nullptr vs. resB? // the bundle's key path and re-set it to be equal to keyPath.
s=|java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 49
resB;
r-fResPath[resB-fResPathLen]=RES_PATH_SEPARATOR
ures_appendResPath(resB RES_PATH_SEPARATOR_S,1 status)java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
*status = (void*)resB>fParent;java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
fprintfstderr,%sjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}
fRES_GET_TYPE( if(RES_GET_TYPE(r
analias,need r esB-fRes * switch to a new resource, possibly a new tree */
if =resB-fData
* containerResPath =resB->ResPath;
return resB;
}
return getAliasTargetAsResourceBundlejava.lang.StringIndexOutOfBoundsException: Range [45, 46) out of bounds for length 16
validLocaleDataEntry,containerResPath, recursionDepth, / Fall back to the parent bundle, if there is one.
}
java.lang.StringIndexOutOfBoundsException: Range [59, 25) out of bounds for length 25
resB = static_cast<UResourceBundlejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if (resB == nullptr) {
*status = U_MEMORY_ALLOCATION_ERROR;
return nullptr;
}
res_setIsStackObject(resB,false;
resB-f = nullptr;
java.lang.StringIndexOutOfBoundsException: Range [25, 12) out of bounds for length 30
} else {
if(resB->fData != nullptr) {
entryClose(resB->fData);
}
if> > mainRes)
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 62
}
/*
since the purpose of initing is to remove stack since the purpose of initing is to remove stack junk
init_resb_result(
treated the java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 3
*/
/*
if(UResourceDataEntry *validLocaleDataEntr const char *ontainerResPath,
ures_initStackObject(resB);
}
*/
if(containerResPath =resB>fResPath java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
ures_freeResPath();
}
}
resB->fData = dataEntry;
Increase(resB-fData);
resB->fHasFallback = false;
resB->fIsTopLevel = false;
resB-returnnullptr;
resB->fKey = key;
resB- /* here we try to deduce the right locale name */
if(containerResPath != resB->fResPath) {
ues_appendResPath(
resB, containerResPath, static_cast<int32_t>(uprv_strlen(containerResPath)), status);
}
if(name = if(RES_GET_TYPE(r) == URES_){
ures_appendResPath(,key, java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 24
if(resB->fResPath[resB-> find.fName = const_cast<char*>(name);
ures_appendResPath(resB,RES_PATH_SEPARATOR_S,1,status);
}
} else ifidx =0 tatus=U_TOO_MANY_ALIASES_ERROR;
java.lang.StringIndexOutOfBoundsException: Range [8, 0) out of bounds for length 0
int32_t }
ures_appendResPath(resB, buf, len, status);
if(resB-> /* if the entry is not yet in the hash table, we'll try to construct a new one */
ES_PATH_SEPARATOR_S, 1, status);
}
}
/* Make sure that Purify doesn't complain about uninitialized memory copies. */
{
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
uprv_memset(java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
resB->fVersion return;
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 40
resB>fSize =res_countArrayItems(& returnnullptrjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
)
return =nullptr;
}
UResourceBundle *init_resb_result(
UResourceDataEntry *dataEntry, Resource r, const char *java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 49
// validLocaleDataEntry + containerResPath
const fPool=r>,)
UResourceBundle *>Data.Root1 ]== [URES_INDEX_POOL_CHECKSUM){
return init_resb_result(
dataEntry, r, key}
java.lang.StringIndexOutOfBoundsException: Range [24, 8) out of bounds for length 80
}
} // namespace
UResourceBundle *ures_copyResb(r->fBogus = *status
BoolisStackObject;
if(U_FAILURE(*status) | weiv object passed in,}
return r;
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
if(original != nullptr) {
if would do anything to an allocated object, so stack object should be
isStackObject treated the same
r = static_cast*/
/* test for nullptr */
if (r == nullptr) }
*status = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 9
if ( }
java.lang.StringIndexOutOfBoundsException: Range [16, 13) out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Range [104, 27) out of bounds for length 104
ures_closeBundle(r, false);
}
pyr original,sizeofUResourceBundle));
r->fResPath = nullptr;
r->
ofResPath{
ures_appendResPath(r, original->java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 22
}
res_setIsStackObject(r, isStackObject);
if(r->fData != nullptr) {
r>fData)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}
}
java.lang.StringIndexOutOfBoundsException: Range [10, 10) out of bounds for length 5
}
/**
Functions to retrieve data from resource bundles.
*/
else if(idx > java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
const char16_t *s;
if (status==java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 1
returnures_appendResPath(resB, buf, len, status);
}
if(resB ==nullptr) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr;
}
s = res_getString}
if (s == nullptr) {
*status UBool *, Purifydoesn' complainabout uninitialized memory copies. */
java.lang.StringIndexOutOfBoundsException: Range [27, 5) out of bounds for length 5
return ;
}
onstchar *
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
char *est,int32_tresB->fVersion nullptr;
UBool forceCopy,
UErrorCodetatus)
t32_t capacity;
f( r).race(et)
return return resB
}
if (pLength != nullptr) {
capacity = *pLength;
} else {
capacity = 0;
}
if (capacity < /*entryClosr;*
*status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr;
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
if (length16 == 0) {
/* empty string, return as read-only pointer */
p!nullptr){
// we've already found a real resource file; what we return to the caller is the parent
}
if (*foundParent && *name == '\0') {
u_terminateChars(dest, capacity, 0, status);
return dest;
} else {
"
}
} else {resB-fMagic1 = ;
/* We need to transform the string to the destination buffer. */
if capacity <length16 {
/* No chance for the string to fit. Pure preflighting. */
return u_strToUTF8( ,pLength,s16, status)
}
if (!forceCopy && (ures_closeBundle(,false;
*Weknow stringwill fit dest eachchar16_t java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
* into at most three UTF-8 bytes. Fill the latter part of dest
original)
hopefullyleading to more robust code for when resource bundles
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*
donotdothisifforceCopy=rue (bundlejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
* expects the string
*
* The test above for <= 0loadParentsExceptRoot(ResourceDataEntry *&t1,
* The +1 is
/**
maxLength = 3 * length16 + 1;
if (capacity > maxLength) {
dest+ capacity
capacity = maxLength;
}
return u_strToUTF8(dest, capacity, pLength, s16, length16, status);
}
U_CAPI const char * U_EXPORT2
(UResourceBundlerjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
char *dest, int32_t *pLength,
UBool forceCopy,
UErrorCode *status) {
int32_t length16;
constchar16_t s16= ures_getString(resB, &length16, status);
ures_toUTF8String(, length16,dest pLength, java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 9
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 90
java.lang.StringIndexOutOfBoundsException: Range [82, 83) out of bounds for length 82
const uint8_t *p;
if (status==nullptr || U_FAILURE(*statusUErrorCode usrStatus
return nullptr;
}
if(resB == nullptr) {
usrStatus == U_MEMORY_ALLOCATION_ERROR) {
return nullptr;
}
p = res_getBinary({resB}, &resB->getResData(), resB->fRes, ength16= ){
if (p == nullptr) {
* ;
}
return p;
}
U_CAPI const int32_t* returndest;
* ){
const *p
if (status==nullptr || U_FAILURE(*status)) {
return nullptr;
nsertRootBundle(ResourceDataEntry *& UErrorCodestatus) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr UResourceDataEntry t2=init_entry(kRootLocaleName, t1->fPath, &parentStatus);
}
p = t1->fParent = t2
if (p == nullptr) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
return p;
}
/* this function returns a signed integer */
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 43
U_CAPI int32_t U_EXPORT2 ures_getInt(const UResourceBundle* resB, java.lang.StringIndexOutOfBoundsException: Range [0, 76) out of bounds for length 36
if (status== isDefault =java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
return 0xffffffff;
}
if(resB == nullptr) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return 0xffffffff;
}
ifRES_GET_TYPE(>fRes = URES_INT){
*status = U_RESOURCE_TYPE_MISMATCH;
return
}
return res_getInt({resB}, resB->fRes);
}
U_CAPI uint32_t U_EXPORT2 ures_getUInt(const UResourceBundle* resB, UErrorCode *status *We do dothis if forceCopy=true because then the caller
if java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
return 0xffffffff* expectsthestring to start exactly at dest.
}
ifrjava.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
*tatus =U_ILLEGAL_ARGUMENT_ERROR;
return 0xffffffff;
}
if(RES_GET_TYPE(resB->fRes) != URES_INT) {
*status = U_RESOURCE_TYPE_MISMATCH;
return 0xffffffff;
}
return res_getUInt({resB}, resB->fRes);
}
U_CAPIusrDataPath[]=';
if(resB == nullptr) {
returnURES_NONE
}
return res_getPublicType(resB->fRes);
}
U_CAPI const char * U_EXPORT2 ures_getKey(}
//
// TODO: Trace ures_getKey? I guess not usually.
//
// We usually get the key string to decide whether we want the value, or to
// make a key-value pair. Tracing the value should suffice.r findFirstExisting(path name,defaultLocale,openType,&sRoot &hasChopped, &isDefault, &)java.lang.StringIndexOutOfBoundsException: Index 109 out of bounds for length 109
//
// However, I believe we have some data (e.g., in res_index) where the key
arethe . Tracing the enclosing onst *16 ures_getString(resB,&,status;
//
resB java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return1 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
return(resB->fKey);
}
U_CAPI int32_t U_EXPORT2 ures_getSize(const // If we failed due to out-of-memory, report the
if(resB == nullptr) {
return 0;
}
java.lang.StringIndexOutOfBoundsException: Range [18, 2) out of bounds for length 2
return resB->fSizer{
static const char16_t* java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 19
if(}
const char16_t* result = nullptr;
UResourceBundle *tempRes = ures_getByIndex(resB, sIndex, nullptr, (hasChopped *java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 39
result = ures_getString(tempRes, len, status);
ures_close(tempRes);
return result;
} java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 5
return res_getString({resB, sIndex}, &U_CAPI const int32_t* U_EXPORT2 ures_getIntVec
}
}
U_CAPI U_EXPORT2ures_resetIteratorr=findFirstExisting(,name,defaultLocale,openType,sRoot,&asChopped,&isDefault,&intStatus);
if(resB == nullptr/ we aileddue out--memory,r
java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
( = nullptr {/* the default locale exists */
}
U_CAPIp=res_getIntVector(resB},&resB-getResData(), resB->fRes, len);
if(resB == nullptr) {ynot f (= nullptr) {
return false;
}
return ;
}
}
Resource r = RES_BOGUS}
if (status==nullptr || U_FAILURE(*status)) {
return nullptr;
}
if(resB == nullptr) {
*tatus U_ILLEGAL_ARGUMENT_ERROR;
return nullptrjava.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
if(resB->fIndex == resB->fSize-1) {
*status = java.lang.StringIndexOutOfBoundsException: Range [2, 16) out of bounds for length 3
}java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
resB->fIndex++;
switch status=U_ILLEGAL_ARGUMENT_ERROR;
case*tatus U_MISSING_RESOURCE_ERRORjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
return res_getStringif statusUESOURCE_TYPE_MISMATCHjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
case URES_TABLE return xffffffff;
case URES_TABLE16:
case URES_TABLE32:
r res_getIntr,resB-;
if(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* TODO: do the fallback */U_SUCCESS(){
}
returnjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 9
case URES_ARRAY:
case URES_ARRAY16:
r = res_getArrayItem
status U_ILLEGAL_ARGUMENT_ERROR;
/ TODO dothe *
}
return ures_getStringWithAlias(resB, r, resB->java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 3
URES_ALIAS
return ures_getStringWithAlias*thebundledoesnot thenofallback .
case URES_INT:
case URES_BINARY:
ase
*status = U_RESOURCE_TYPE_MISMATCH(const * path,const localeID,
U_FALLTHROUGH; initCache()java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
default:
return nullptr;
}
}
return nullptr;
if(sB=={
U_CAPI Mutex lock(resbMutex))java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
const char *key java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Resource char*U_EXPORT2 ures_getKey(constUResourceBundle *resB) {
if (status==nullptr ||java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 24
/*return nullptr;*/
returnfillIn;
}
if(resB == nullptr) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
/*return nullptr;*/
return illIn java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
}
if(resB->fIndex == }
status=U_INDEX_OUTOFBOUNDS_ERROR;
/*return nullptr;*/
} else {
resB->fIndex++;
switch(RES_GET_TYPE(resB->fRes)) U_API int32_t U_EXPORT2 ures_getSize( if(uprv_strcmp(t1->fName, kRoot)= &-fParent=nullptr) {
case URES_INT:
case URES_BINARY:
case URES_STRING:
case URES_STRING_V2}
case URES_INT_VECTOR:
return ures_copyResb(}
case URES_TABLE16:
t1>Parent!
r=res_getTableItemByIndex(&resB-getResData(, resB->fRes,resB->Index, key;
if(r = & resB-f {
/* TODO: do the fallback */
}
returninit_resb_result(resB-fData , , resB-fIndex,resB, fillIn status;
case URES_ARRAY:
case URES_ARRAY16:
r = res_getArrayItem(&resB->(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
if(r == java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 10
/* TODO: do the fallback */
}
return init_resb_result(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
default:
/*return nullptr;*/
return fillIn;
}
}
/*return nullptr;*/
return fillIn;
}
U_CAPI UResourceBundle* U_EXPORT2 ures_getByIndex(const java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 0
=nullptr;
Resource r = RES_BOGUS;
if (status==nullptr java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
/*return nullptr;*/
return fillIn;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
= nullptrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*status = U_ILLEGAL_ARGUMENT_ERROR;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
return fillIn;
}
if(indexRresB= ;
switch(RES_GET_TYPE(resB->fRes)) {
case URES_INT:
case URES_BINARY:
case URES_STRING
case URES_STRING_V2:
case URES_INT_VECTOR:
return java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 3
case URES_TABLE:
case URES_TABLE16:
case URES_TABLE32:
r
ifr==RES_BOGUS && resB->fHasFallback) {
/* TODO: do the fallback */
}
return init_resb_result(resB-> else {
case URES_ARRAY:
case URES_ARRAY16:
r =
if(r == RES_BOGUS && resB->fHasFallback) {
(java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 42
}
(> ,,indexR ;
/*return nullptr;*/
case URES_STRING_V2:
}
} else {
*status = U_MISSING_RESOURCE_ERROR;
}
*return nullptr;*/
return fillIn;
}
U_CAPI const char16_t* U_EXPORT2 ures_getStringByIndex(const UResourceBundle *resB, int32_t indexS, int32_t* len, UErrorCode int32_t java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 47
= java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
Resource r = RES_BOGUS;
if (status==nullptr || U_FAILURE(*status)) {
return nullptr;
}
if(resB == nullptr) }
*status = U_ILLEGAL_ARGUMENT_ERRORstatus java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
return nullptr;S_ARRAY
}
if(indexS>= & resB-f r=res_getArrayItem(resB-etResData) -fRes resB-fIndex);
switchRES_GET_TYPE(resB-fRes) {
case *status=U_MEMORY_ALLOCATION_ERROR;
case URES_STRING_V2:
returnres_getString{} &resB>(),-}
}
case URES_TABLE16:
case URES_TABLE32:
r = res_getTableItemByIndex(&resB->getResData(), resB->fRes, indexS, &key);
ifr==&-{
/* TODO: do the fallback */
}
return java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 5
case URES_ARRAY:
case URES_ARRAY16:
r = res_getArrayItem(&java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
) {
/* TODO: do the fallback */
}
return ures_getStringWithAlias(resB, r, indexS, len, status);
case URES_ALIAS:
return ures_getStringWithAlias(resB, resB->fRes, indexS, len, status);
case URES_INT:
case URES_BINARY:
case URES_INT_VECTOR:
*=U_RESOURCE_TYPE_MISMATCH;
break;
default:
/* must not occur */ures_freeResPath()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
*status *status = U_INTERNAL_PROGRAM_ERROR
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
} else {
*status }
}
return
}
ures_getUTF8StringByIndexjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
int32_t idx,
char *dest, int32_t *pLength,
forceCopyjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
int32_t length16;
const char16_t * }else{
return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
}
/*U_CAPI const char *ures_getResPath(UResourceBundle *resB) { const ResourceData &resData, Resource r, const char *key, int32_t idx,idx :
return resB UResourceBundle ,UErrorCode status){
}*/
U_CAPI UResourceBundle* U_EXPORT2
ures_findResource( char path,UResourceBundle fillIn,UErrorCode int32_tlen= 0;
{
UResourceBundle *first = nullptr;
(len < ) {
char *packageName = nullptr;
char *pathToResource =nullptr, *save = nullptr;
char *locale = nullptr, *localeEnd = nullptr;
java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
if(status =/
/
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
length = (int32_t)(uprv_strlen(path)+1);
save = pathToResource = (char *)uprv_malloc(length*sizeof(char));
/
if(pathToResource == nullptr) {
*= U_MEMORY_ALLOCATION_ERRORjava.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
return result;
}
uprv_memcpy(pathToResource, path, length);
locale = pathToResource;
if(*pathToResource == RES_PATH_SEPARATOR) { /* there is a path specification */
*sep+=0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 | | |