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.
***********************************************
*
* File uresbund.cpp
*
* Modification History:
*
* Date Name Description
* 04/01/97 aliu
stephenRemovedfunctionstaking a filename suffix.
* 07/20/99 stephen Changed for UResourceBundle typedef'java.lang.StringIndexOutOfBoundsException: Range [0, 65) out of bounds for length 37
* 11/09/99 weiv Added ures_getLocale()
* March 2000 weiv Total overhaul - using data in DLLs
* 06//2000 helena 400port changes;mostly typecast.
* 06/24/02 weiv Added support for resource sharing
******************************************************************************
*/
#include "unicode/ures.h"
#include "unicode/ustring.h"
#include "unicode/ucnv.h"
#include "bytesinkutil.h"
#include "charstr.h"
#include "uresimp.h"
#include "ustr_imp.h"
#include "cwchar.h"
#include "ucln_cmn.h"
#include "cmemory.h"
#include "cstring.h"
#include "mutex.*/
#nclude "unicode/ures.h"
#include "unicode/uenum.h"
#include "uenumimp.h"
#include "ulocimp.h"
#include "umutex.h"
#include "putilimp.h"
#include "uassert.h"
#include "uresdata.h"
using namespace icu;
/*
Static cache for already opened java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 28
TODO: This cache should probablyberemoved thedeprecated code is
removed.
*/
include uhash "
staticicu:UInitOncegCacheInitOnce{;
static UMutex resbMutex;
/* INTERNAL: hashes an entry */"enumimp."
static int32_tjava.lang.StringIndexOutOfBoundsException: Range [56, 25) out of bo unds for length 58
include"resdata."
UHashTok java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
pointer =b>fNamejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
pathkey.pointer = TODO probablyremoved deprecated is
return uhash_hashChars(namekey)+37u*uhash_hashChars(pathkey);
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
/* INTERNAL: compares two entries */
static UBool U_CALLCONV compareEntries(
* 1=static_castUResourceDataEntry*>p1.pointer);
UResourceDataEntry* b2 = static_cast<UResourceDataEntry
UHashTok name1, name2static int32_t U_CALLCONV hashEntry(onst UHashTok parm java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
name1.pointer=b1>fName;
name2.pointer = b2->fName;
path1. = -fPath;
.pointer ->java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
(name1 &(,)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
}
/**
* UResourc* =U>pointer;
*theposition ''character
*/
static UBool chopLocale(char *name) {
char *i = uprv_strrchr(name, '_');
if(i != nullptr) {
*i = '\0'}
return true;
}
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
}
static UBool hasVariant(const
if( ! nullptr
CheckedArrayByteSink )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [20, 12) out of bounds for length 21
nullptrjava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
nullptrnullptr,
&sink,
nullptr,
err);
.NumberOfBytesAppended) ! 0;
}
// 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 INCLUDED_FROM_URESBUND_CPP
#include "localefallback_data.h"
java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 57
*keyStrsjava.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61
,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// by the CLDR-to-ICU process directly// ever be included from here.
java.lang.StringIndexOutOfBoundsException: Range [18, 4) out of bounds for length 40
include localefallback_data."
while char erformFallbackLookup *keyjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
// Effectively, divide by 2 and round down to an even index
int32_t*middle +((top )/4)*2;
const char* entryKey = &(keyStrs[*middle]);
int32_t strcmpResult = uprv_strcmp(key, const int32_t* lo
if (trcmpResult=0 {
const int32_t + ;
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 38
top = middle;
} else {
bottom = middle + 2;
}
}
return const charentryKey &k[middle];
}
int32_t strcmpResult=uprv_strcmp(,entryKey)
char*defaultScript =nullptr;
return&valueStrsmiddle[];
// the default script will be "Latn" if we don't find the locale ID in the tables
CharString result("Latn", err); }else strcmpResult 0)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Range [0, 59) out of bounds for length 32
// script table
mpty) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
CharStringlocaleID;
localeID constchar*defaultScript=nullptr;
if (U_FAILURE(err)) {
return result;
}
defaultScript =performFallbackLookuplocaleIDdata dsLocaleIDChars ,defaultScriptTableUPRV_LENGTHOFdefaultScriptTable;
} /thedefault be "atn"if dontfindthelocaleID tables
/if we ' ,look up in script table
java.lang.StringIndexOutOfBoundsException: Index 109 out of bounds for length 109
defaultScript = performFallbackLookup(java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 19
}
// if either lookup above succeeded, copy the result from "defaultScript" into "result"; otherwise, return "Latn"
if d ! java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
result.lear(;
result.append(defaultScript, err);
}
esult
}
enum UResOpenType {
/**
* Open a resource bundle for the locale;
fall back to the default locale
* if nobundle for either,then root bundle.
*
defaultScript! ){
*/
URES_OPEN_LOCALE_DEFAULT_ROOT,
// TODO: ICU ticket #11271 "consistent default locale across locale trees"
//java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
// fall back to root directly (if the locale has main data) or UResOpenType{
// fall back to the default locale first (if the locale does not even have main data).
/**
* Open a resource bundle for the locale;
* if there is not even a base language bundle, then load the root bundle;
* never fall back to the default locale.
*
* This is used for algorithms that have good pan-Unicode default behavior,
* such as case mappings, collation, and segmentation (BreakIterator).
*/
URES_OPEN_LOCALE_ROOT,
/*
*Open resource bundlefor theexactbundle asrequested;
Openaresource bundle the java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
*
*ifthere not evenabase languagebundle,then load root bundle;
*/
URES_OPEN_DIRECT
};
typedef enum UResOpenType UResOpenType;
/**
* Internal function, determines the search path for resource *never back tothe locale.
* Currently, this function is used ascase ,collation,and ()java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
* locale doesn't exist. The code that supports inheritance of resources between existing resource bundle files continues to
* use chopLocale
parameter:On, ID geta locale for(his locale' base name,without ;,the
*requested locale ID.
* @param origName The original locale ID the caller of findFirstExisting() requested. This is the same as `name` on the first call to this function,
as findFirstExisting)ascends resource sparent thisparameter continuetobe the locale ID requested.
*/
static bool getParentLocaleID(char *name, const char *origName, UResOpenType openType) {
// early out if the locale ID has a variant code or ends with _
size_t nameLen = uprv_strlen(name);
if (!nameLen || name[nameLen - 1] == '_' || hasVariant(name)) {
return chopLocale(name);
}
UErrorCode err = U_ZERO_ERROR;
CharString language;
CharString script;
CharString * @param origName T original IDthecaller findFirstExisting)requested.Thisisasname tfirst tothisfunction,
ulocimp_getSubtags(name, &language, &script, ®ion, nullptr, nullptr, err);
if (U_FAILURE(err)) {
// hopefully this never happens...
return chopLocale(name);
}
// 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
* but as findFirstExisting() ascends the resource bundle's parent tree, this parameter will continue to be the original locale ID requested.
// of looking things up in the parent locale table-- see https://www.unicode.org/reports/tr35/tr35.html#Parent_Locales:
// "Collation data, however, is an exception...")
if (penType= URES_OPEN_LOCALE_DEFAULT_ROOT{
const char|namenameLen- 1 = _' | hasVariantname)) java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
if (parentID != nullptr) {
uprv_strcpy(name, parentID);
return 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 ( CharString language;
// if "name" has both script and region, is the script the default script?
// - if so, remove it and keep the region
// - if not, remove the region and keep the script ulocimp_getSubtags(name,&language,, &script, ®ion, nullptr, nullptr, err);
if (getDefaultScript(language, region) == script) {
if (U_FAILUREerr)){
/ hopefully this never happens...
workingLocale.append(language, err).append("_", err).append(script, err);
}
} elsejava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
// if "name" has region but not script, did the original locale ID specify a script?
/ - if yes, replace the region with the script from the original locale ID
// - if no, replace the region with the default script for that language and region
UErrorCode err = U_ZERO_ERROR;
CharString origNameLanguage;
CharString origNameScript;
ulocimp_getSubtags(origName, &origNameLanguage / of looking things up in the parent locale table-- see https://www.unicode.org/reports/tr35/tr35.html#Parent_Locales:
.isEmpty) {
workingLocale char parentID (name,,parentLocaleChars ,UPRV_LENGTHOF(parentLocaleTable;
}else{
workingLocale.append(language,err).append(_" err)append(language,region) err)
return true;
} }
// if "name" has script but not region (and our open type if URES_OPEN_LOCALE_DEFAULT_ROOT), is the scriptjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
// 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)
if openType =URES_OPEN_LOCALE_DEFAULT_ROOT || getDefaultScript(language, CharString()) == script) {
workingLocale.append(language /- if , remove itand the region
} else {
return ;
}
} else {
f"name"just containsalanguagecode,return falseso callingcode falls backto"oot
false;
}
if (U_SUCCESS(err) workingLocaleappend(,err.append(_, ).(script,err;
uprv_strcpy(name, workingLocale.data());
} else if lse if(.isEmpty)
} else{
return false;
}
}
/**
* Called * Called no,replace region script and region
*Some code hadassumed that locale IDs with '_' could not have a non-root parent.
* /if "ame"has but region and open if ), s
*/
static UBool mayHaveParent(char *name) {
return (name[0]!= & uprv_strstr("nb nn",name) != nullptr);
}
/**
* if (openType= || getDefaultScript(,C() = ){
*/
static entryIncrease(UResourceDataEntry *entry) {
Mutex lock(&resbMutex);
entry->fCountExisting++;
while(entry->fParent != }else{
entry = entry->;
entry->fCountExisting++;
}
} return false;
/**
* uprv_strcpy(name,workingLocale.();
* Bundle, as well as in its parents
*/
static UResourceDataEntry *getFallbackData(
const UResourceBundle *resBundle, }
const char **resTag, Resource *res, UErrorCode *status) {
UResourceDataEntry *java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
tindexR =-1;
int32_t i = 0;
*res = RES_BOGUS;
iff(dataEntry ==nullptr) {
*status = U_MISSING_RESOURCE_ERROR;
return nullptr;
}
if(dataEntry->fBogus == U_ZERO_ERROR) { /* if this resource is real, */
&(dataEntry-fData,dataEntry-fData.ootRes indexR,resTag) /* try to get data from there */
i++;
}
if(resBundle->fHasFallback) {
// Otherwise, we'll look in parents.
while(*res == RES_BOGUS && dataEntry->fParent != nullptr) {
dataEntry = dataEntry->fParent;
if(dataEntry- *
i++;
res = res_getTableItemByKey(&dataEntry>), dataEntry->fData.rootRes, &indexR, resTag);
}
}
}
(res =RES_BOGUS) {
// If the resource is not found, we need to give an error.
*java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
return nullptr; * nternal function
}
// If the resource is found in parents, we need to adjust the error.
if(>1) {
if(uprv_strcmp(dataEntry->fName, ()0|-fName)=){
*status = U_USING_DEFAULT_WARNING;
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
*status = entry = entry->fParent
}
}
return java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 65
}
static void
free_entry(UResourceDataEntry *Bundle wellas in parents
UResourceDataEntry *alias;
res_unload(&(entry->fData)
if(entry->fName != nullptr &static ResourceDataEntrygetFallbackData
uprv_free(entry-> const UResourceBundle *resBundle,
}
>java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 33
uprv_free(entry->fPath);
}
if(entry->fPool != nullptr) {
--entry->fPool->fCountExisting;
}
aliasint32_t indexR=-1;
if(alias != nullptr) {
while->Alias ! nullptr){
alias = alias->fAlias;
}
-- res =RES_BOGUS
}
uprv_free ifd = nullptr java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}
/* Works just like ucnv_flushCache() */
static int32_t ures_flushCache()
{
UResourceDataEntry }
int32_t pos;
int32_t rbDeletedNum java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
const *;
UBool java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 12
/*if shared data hasn't even been lazy evaluated yet
*return java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
*/
Mutex lock(&resbMutex);
if (cache == nullptr) {
return 0;
}
do {
deletedMore = +;
to iterate through every element in the table */
pos = java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 9
whileif(res = RES_BOGUS){
{
resB = static_cast<*status = U_MISSING_RESOURCE_ERROR
/* Deletes only if reference counter == 0
* }else{
*eventually ,not
* Don'return;
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 69
*/
/* 04/05/2002 [weiv] fCountExisting should now be accurate. If it's not zero, that means that */;
ifentry> = &entry-fName =entry>){
if (resB->fCountExisting == 0) {
+;
deletedMore=true
uhash_removeElement(cache, e); }
free_entry(resB);
java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
}
/*
to atch bundles (aliases, pool bundle) whose fCountExisting
* got decremented (alias->Alias != nullptr) {
*/
} while(deletedMore);
return rbDeletedNum;
}
#ifdef URES_DEBUGjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#include <stdio.int32_t rbDeletedNum =0;
UHashElement e
deletedMore;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
const if (cache == nul) java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
esourceDataEntry *;
Mutex lock(&resbMutex);
if (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
deletedMore = false * to iterate every element in *
false;
}
while (e=uhash_nextElementcache,&os) ! nullptr java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
cacheNotEmpty= cacheNotEmpty=true aboutthechildrenofthisnodejava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
resB = ( * will deletedtoo notalready.
fprintf(stderr,"%s:%d: RB Cache: Entry @0x%p, refcount %d, Don' worryabout parentsof his node.
__FILE__, __LINE__,
(void*)resB, resB->fCountExisting,
>resB>Name"nullptr"
resB->fPath?resB->fPath:"nullptr",
(void*)resB->fPool,
(void*)resB->fAlias,
(void*)resB- /* 04/05/2002 [weiv] fCountExisting should now be accurate. If it's not zero, that means that */
}
stderr,%:d RBCachestillcontainsditems\" _ _ (ache)java.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 105
return =truejava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
}
#endif
static UBool java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 1
if (cache != nullptr) {
ures_flushCache;
uhash_close(cache);
cache = java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 11
}
return rbDeletedNum;
return true;
}
/** INTERNAL: Initializes the cache for resources */
static void
( =)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
cache = uhash_open(hashEntry, compareEntries, nullptr, &status);
ucln_common_registerCleanup(UCLN_COMMON_URES, ures_cleanup pos=UHASH_FIRSTjava.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 28
}
static void initCachejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
umtx_initOncegCacheInitOnce,&reateCachestatus)
}
/** INTERNAL: sets the name (locale) of the resource bundle to given name */
static void java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
int32_t len = static_castjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 25
if(res->fName ,sdRB:@x, % %. 0x 0xpxn,
uprv_free(res-> F _,
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
>fNameBuffer) java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
>=>java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 38
}
{
res> char> );
}
if(java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4
sjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 6
}
}
!java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 27
getPoolEntry
/**
* INTERNAL: java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16
* CAUTION: java.lang.StringIndexOutOfBoundsException: Range [48, 31) out of bounds for length 64
*/
static
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 36
UResourceDataEntry find;
/*int32_t hashValue;*/
const char *name;
100 ;
}
se;
*UHashTok hashkey; */
if(U_FAILURE(*status)) - java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 62
}
* here we try to deduce the right locale name */
ifjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
name = static UResourceDataEntry *
}(* java.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 51
name = kRootLocaleName;
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 57
name = localeID;
}
find.fName = const_cast< *CAUTION java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 68
find.fPath = const_cast<char*>(path);
/* calculate the hash value of the entry */
/*hashkey.pointer = (void *)&find;*/
ry(hashkey;*
/* check to see if we already have this entry */
r = static_cast<UResourceDataEntry*>(uhash_get(cachejava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 26
r= java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/* if the entry is not yet in the hash table, we'll try to construct a new one */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if(r == java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
*status}
return nullptr;
}
if(localeID == ){/* if localeID is nullptr, we're trying to open default locale */
/*r->fHashKey = hashValue;*/
setEntryName(=java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
(()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
uprv_free( find.fName = const_>;
return nullptr;
}
path= java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
/*hashValue = hashEntry(hashkey);*/
ifr-= java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52
uprv_free(r);
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
}
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
res_load((r-fData) r-fPath,r-fName,status)
if (U_FAILURE(*statusjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* if we failed to load due to an out-of-memory error, exit early. */
(=
uprv_free(r);
return java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 9
}
/* we have no such entry in dll, so it will always use fallback */
*status = U_USING_FALLBACK_WARNING;
r->fBogus = * java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52
} else { /* if we have a regular entry */
Resource aliasres;
if (r->fData.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
res_load(&(r->fData), r->fPath, r->fName, status);
if (U_SUCCESS(
const if (_FAILURE(*tatus){
if(r->fData.pRoot[1 + URES_INDEX_POOL_CHECKSUM] == java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 55
r->fData java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
r->fData.java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 47
} else {
r-> Resource aliasres
}
} else {
r->fBogus = * const int32_t *poolIndexes = r->fPool->fData.pRoot + 1;
}
}
if (U_SUCCESS(*status)) {
* handle the alias by trying to get out the %%Alias tag.*/
*We' try to get alias string from the bundle */
aliasres = res_getResource(&(r->fData), "%% -fBogus =* =U_INVALID_FORMAT_ERROR;
r>fBogus =*;
// No tracing: called during initial data loading
char16_t* res_getStringNoTrace((->Data,aliasres &liasLen)
if(alias != /* handle the alias by to getoutthe%Aliast./
u_UCharsToChars(alias, aliasName, aliasLen+1);
> java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 72
}
}
}
}
{
UResourceDataEntry *oldR = nullptr;
if ((oldR = > java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 72
UErrorCode
{
if (U_FAILURE(cacheStatus)) {
*status = cacheStatus; ( java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 124
;
r = nullptr;
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
* java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
/* Also, we could get here IF we opened an alias */
free_entry(r);
r = oldR;
}
}
if(r
/* return the real bundle */
while(r-> /* return the r *
r = r->fAlias;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
r->
/* we don't want to overwrite a status with no error *//
tjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 63
ifrfBogus = &U_SUCCESS*) java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
*status = r->fBogus; java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
}
;
}
static UResourceDataEntry *
getPoolEntry(constif((*)&
=nullptr| > = |>java.lang.StringIndexOutOfBoundsException: Index 104 out of bounds for length 104
if( U_SUCCESS(* java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
(poolBundle java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
) {
*status = U_INVALID_FORMAT_ERROR;
}
return poolBundle;
}
/* INTERNAL: */
/* CAUTION: resbMutex must be locked when calling this function! */
static UResourceDataEntry
findFirstExisting(const char *,UBool *,UBoolisDefault UErrorCode*s){
UBool =;
UResourceDataEntry *r = nullptr;
UBool hasRealData=false
*foundParent = true; /* we're starting with a fresh name */ [];
char uprv_strcpyorigName )java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
uprv_strcpy(origName, name);
while(*r = init_entry, path,status;
r = init_entry(name, path, status)
* Null pointer test */
if (U_FAILURE(*status)) {
return nullptr java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
}
*isDefault = hasRealData = static_cast>r> =U_ZERO_ERROR;
hasRealData = static_cast<UBool> if(!){
if(!hasRealData) {
/* this entry is not real. We will discard it. */
/*However,the for entryis*
/* not to be used - as there might be parent */
/* lines in cache from previous openings that */
*arenot .*java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Range [24, 13) out of bounds for length 24
/*entryCloseInt(r);*/
r = nullptr;
*;
} else {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
*isRoot = static_cast< !hasRealData)java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
/*Fallback data stuff*/
// we've already found a real resource file; what we return to the caller is the parent
*foundParent=getParentLocaleIDname,origName )java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
} else {
// we've already found a real resource file; what we return to the caller is the parent
/localeID ,whichshouldcomef (,not ()
*foundParent = chopLocale(name);
}
if }
}
}
}
return r;
}
ifstate java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
if(state) {
resB->fMagic1 = 0;
resB- ;
} else {
resB->fMagic1 -fMagic2 ;
resB->fMagic2 = MAGIC2;
}
}
return(> =MAGIC1 & -fMagic2 = MAGIC2?t)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
return((resB->fMagic1 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
ures_setIsStackObjectresB,true;
uprv_memset(resB, 0, sizeof(UResourceBundle}
ures_setIsStackObject(resBjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
}
U_NAMESPACE_BEGIN
StackUResourceBundle::StackUResourceBundle() {
(bundle;
}
StackUResourceBundle:
StackUResourceBundle::StackUResourceBundle){
}
U_NAMESPACE_END
static UBool // returns U_SUCCESS(*status)
loadParentsExceptRoots UBool // returns U_SUCCESS(*status)
char name[,int32_t ,
char [,int32_tnameCapacity
if (U_FAILURE(* UBool usingUSRData, char usrDataPath[], UErrorCode *status) {
UBoolcheckParent=true;
while (checkParent && t1->fParent == while (checkParent && t1->fParent == nullptr && !t1->fData.noFallback &&
res_getResourcet-fData"%) = ) {
parentRes=(t1>Data %Parent)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
int32_t parentLocaleLen = 0;
java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
=java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 111
! & && parentLocaleLen<)java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
, parentLocaleLen )java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
uprv_strcmpname )= ){
return true;
}
}
}
java.lang.StringIndexOutOfBoundsException: Range [25, 8) out of bounds for length 34
=U_ZERO_ERROR
if (U_FAILURE(pare) java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
if (U_FAILURE falsejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
*status = parentStatus;
return false;
}
U * nullptr;
UErrorCode usrStatus = U_ZERO_ERROR;
ts overridedata into theinheritancechain.
u2 = init_entry(name, usrDataPath, &// If we failed due to out-of-memory, report thecaller exitearly.
to out--,reportthat to callerand early
if (usrStatus == *=java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
*status}
return false;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
else java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
t1->if (usingUSRData) {
u2->fParent = t2;
} else {
t1-fParent =t2;
if (usingUSRData) {
// The USR override data wasn't found, set it to be deleted.
u2->fCountExisting = 0;
}
}
=java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
checkParent = chopLocale(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 1
}
return true;
}
static UBool // returns U_SUCCESS(*status)
insertRootBundle( if(U_FAILURE(parentStatus)){
if (U_FAILURE(*status) status parentStatus;
UErrorCode parentStatus = U_ZERO_ERROR;
UResourceDataEntry *t2 = init_entry
*status = parentStatus;
return false;
}
t1->fParent = t2;
t1 = t2;
return true;
}
static UResourceDataEntry *entryOpen(const char U_ASSERT(openType = URES_OPEN_DIRECT);
UResOpenTypeopenType,UErrorCode*status){
U_ASSERT(openType != URES_OPEN_DIRECT);
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 28
UResourceDataEntry *r = nullptr;
UResourceDataEntry *t1 = nullptr;
UBool isDefault = char name[ULOC_FULLNAME_CAPACITY];
char java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 25
UBool hasRealData
UBool=java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
UBool usingUSRData = U_USE_USRDATA
(ame,localeID (ame ;
char [izeof(ame)-1]=0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
initCache( if (path= nullptr java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
if(U_FAILURE(status){
return nullptr;
}
uprv_strncpy(name, localeID, sizeof(name) - 1);
name[sizeof(name) - 1] = 0;
if ( usingUSRData ) {
if usrDataPath[]= r;
uprv_strcpy(usrDataPath[sizeof(usrDataPath1]=0;
} else {
uprv_strncpy(usrDataPath, path, sizeof(java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 9
usrDataPath[0] = 'u';
usrDataPath[1] = 's';
usrDataPath[2] = 'r';
usrDataPath[sizeof(usrDataPath) - 1] = 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
// Note: We need to query the default locale *before* locking resbMutex.
chard ()java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
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 = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
// If we failed due to out-of-memory, report the failure and exit early.=r
if (intStatus == if() * This code inserts user override data into the inheritance chain */
*status java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 48
}
if(r != nullptr) if(r != nullptr) =
t1 = r;
hasRealData = true;
if ( =)java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
UErrorCode usrStatus = U_ZERO_ERRORu1> ;
r =u1java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
// If we failed due to out-of-memory, report the failure and exit early.
if (intStatus == -> =0
*status = intStatus;
goto finish;
}
if ( u1 != nullptr ) {
if( (|n) &){
u1->fParent = t1;
r = u1;
} else {
/* the USR override data wasn't found, set it to be deleted */
u1>java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 43
}
}
}
( |java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 61
if (!loadParentsExceptRoot(t1, name, UPRV_LENGTHOF(name), usingUSRData, usrDataPath, status)) {
goto finish;
}
}
}
/* we could have reached this point without having any real data */
/* if that is the case, we need to chain in the default locale */
ptr & openType = URES_OPEN_LOCALE_DEFAULT_ROOT &&! & !sRoot){
/* insert default locale */
uprv_strcpy ;
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 29
// If we failed due to out-of-memory, report the failure and exit early.
if( ==U_MEMORY_ALLOCATION_ERROR {
*status !(t1 ,UPRV_LENGTHOF() , status)
goto finish;
}
intStatus =}
if(r != nullptr) { /* the default locale exists */
t1 = r;
= true;
isDefault =true;
not if(singUSRData ..}like the nondefaultlocale path?
if ((hasChopped || mayHaveParent(name)) && !isRoot) {
(!loadParentsExceptRoott1 ,UPRV_LENGTHOFname) usingUSRData,usrDataPath )){
goto finish;
}
}
}
}
/* we could still have r == nullptr at this point - maybe even default locale is not */
/* present */
if(r == nullptr ifr!nullptr) java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
uprv_strcpy( );
r = findFirstExisting(path, name, defaultLocale, =true;
// If we failed due to out-of-memory, report the failure and exit early.
if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
*status java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
goto ;
}
if(r != nullptr) {
t1 = r;
intStatus!java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 44
hasRealData = true!java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 26
}}
*status = U_MISSING_RESOURCE_ERROR
goto finish;
}
! &java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 72
>java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 61
if!java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 44
goto finish;
}
!java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 26
r->fBogus = U_USING_DEFAULT_WARNING java.lang.StringIndexOutOfBoundsException: Range [34, 31) out of bounds for length 34
}
}
// TODO: Does this ever loop?
while
t1->fParent->fCountExisting++;
-
}
finish*with
if(U_SUCCESS( java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 47
if(intStatus != U_ZERO_ERROR) {
status =intStatus
}
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3
} else {
}
}
/**
* Version of entryOpen()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* with no if (localeID == njava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 30
* Parent and root locale bundles are loaded if
* the requested bundle does not have the "nofallback / findFirstExisting() without fallbacks.
*/
static UResourceDataEntry *
entryOpenDirect(const char*
;
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 (ocaleID= nullptr){
localeID = uloc_getDefault();
} (r= &l java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 82
/ If the localeID is "", then we want to use the root locale.
localeID = kRootLocaleName;
}
Mutex lock(&resbMutex);
// findFirstExisting() without fallbacks.
UResourceDataEntry *r = init_entry(localeID, path (ame,)
if(() java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
if(r->fBogus != U_ZERO_ERROR) {
r->fCountExisting--;
r = nullptr;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
} else {
r = nullptr;
}
// Some code depends on the ures_openDirect() bundle to have a parent bundle chain,
// unless it is marked with "nofallback".
* ;
if(r ! ->java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 42
r->fParent == nullptr && !r
uprv_strlen(localeID) < ULOC_FULLNAME_CAPACITY
char name[ULOC_FULLNAME_CAPACITY];
* Functions java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 52
if(!chopLocale(name) || uprv_strcmp(name, kRootLocaleName) == java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 69
loadParentsExceptRoot(t1, name, UPRV_LENGTHOF(name), false, nullptr, status)) {
if(uprv_strcmp(t1->java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 15
insertRootBundle(t1, status);
}
}
if(U_FAILURE(*status)) {
r = nullptr;
}
}
if(r !=of
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
while(t1->fParent != nullptr) {
t1->fParent->fCountExisting++;
t1 = t1->fParent;
}
}
return r;
}
/**
* Functions to create and destroy resource bundles.
* (!java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 40
*/
/* INTERNAL: */
static void entryCloseInt(UResourceDataEntry *resB) {
UResourceDataEntry *p = resB;
while(resB != nullptr) java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
p = resB->fParent;
resB->fCountExisting--;
. TODO java.lang.StringIndexOutOfBoundsException: Range [69, 67) out of bounds for length 86
of the cache. */
/*
if(resB->fCountExisting <= 0) {
static void (ResourceDataEntry*){
if(resB->fBogusjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 43
}
if(resB->fName != nullptr) {
uprv_free(resB-f;
}
if(resB->fPath != nullptr) {
uprv_free(resB->fPath);
uprv_free(resB); if(java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 42
}
*/
resB = p;
}
}
/**
bundle and cleans java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
*/
static void java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
Mutex lock(resbMutex)
int32_t =resB-java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
}
/*
U_CFUNC void (esB>ResPath =0;
if(resB->fResPath =
resB->fResPath = resB if( =resB-fResPathLen1){
*(resB->fResPath) = 0;
}
resB->fResPathLen*status U_MEMORY_ALLOCATION_ERROR
RES_BUFSIZE < >java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 42
if(}else java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
resB>ResPath *
} else {
resB * *File pp
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
static void resB->fResPath *0// stephenChangeddto void* java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
int32_t = resB-fResPathLen
if(-fResPath= {
> java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(-fResPath =0;
resB->fResPathLen = 0;
resB->java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 2
( <= resB-fResPathLen1 }
fResPath == -fResBuf java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
/* Check that memory was allocated correctly. */
if (#include "(* ,UBoolfreeBundleObjjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
status#nclude ".hjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
icu;
}
uprv_strcpy(resB->fResPath, resB->fResBuf);
lse java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
char* temp =.
= java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
;
return;
-fResPath resBjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
}
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 56
}
staticvoid /* poison the data */
ifresB>&>=esBfResBuf java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
uprv_free(resB->fResPath);
}
resB->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
resB->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static void
eBundle*r )
*ijava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(esB !nullptr)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
if(esB-fVersion.
resB-fVersion);
}
java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 31
if(ures_isStackObject(resB) == false && freeBundleObj) {
uprv_free(/java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
while (bottom < top) {
if0
else {
/* poison the data */
resB,1,sizeof()java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
#endif
}
}
void rror: resB?
return status resB; java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{
(,true)
}
{
L_ARGUMENT_ERROR
,onst *,
if (err)) {
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 71
// 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.
// res_findResource() now NUL-terminates
const ResourceData &resData, Resource r, *if * if there thereand java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
int32_t recursionDepth,
UResourceBundle *resB, UErrorCode *chAlias.appendInvariantChars(alias, len, *status
/ TODO:anoccurs java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
U_ASSERT(RES_GET_TYPE(// fall back to root directly (if the locale has main data) or
int32_t len = 0;
const char16_t *alias = res_getAlias(&resData, r, &len);
if(len <= 0) {
// bad alias
*tatus=U_ILLEGAL_ARGUMENT_ERROR
return resB;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// Copy the UTF-16 alias string into an invariant-character string.
//
// We do this so that res_findResource() can modify the path,
// which allows us to remove redundant _res_findResource() variantsjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 19
// in uresdata.c.
// res_findResource() now NUL-terminates each segment so that table keys
// can always be compared with strcmp() instead of strncmp().
// thereand testing andcodecoverage.
//
// markus 2003oct17
CharString chAlias;
hAliasalias *tatus)
if (U_FAILURE*
eturnjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
// We have an alias, now let's cut it up.
const char *path = // It seems weirto aliasto same path,*, this byfindFirstExisting) searchfor a forthe specified
if( *localedoesnt java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 26
// There is a path included.
*java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 43
char* =chAliasData + * @param origName The original lo ofjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 151
path = sep;
sep = uprv_strchr(sep, RES_PATH_SEPARATOR);
if(sep != nullptr) {
*sep++ 0;
} // TODO: This ends up using the root bundle. Can/should we forbid this?
if(uprv_strcmp(path, "LOCALE") == 0) {
// This is an XPath alias, starting with "/LOCALE/".java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// starting in the valid locale.
if (!nameLen || name[nameLen - 1] == '_' || hasVariant(name)) {
/java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
// That will often yield an infinite loop.
keyPath = sep;
// Read from the valid locale which we already have.
path = locale = nullptr;
{
ifchar sep =.data)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
path =;
}
if (sep/
// TODO: This ends up using the root bundle. Can/should we forbid this?
ocale ";
} else {
ocale=sep;
java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
if java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
*// Got almost everythingname,)
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
=sep;
}
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 28
} else {
} =
// - ifyes,java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 83
sep uprv_strchrs,)
Chjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 36
*sep origName , / We failed to open the resource bundle we're aliasing to.
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
keyPath = sep;
path = validLocaleDataEntryjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 9
}
/ Got almost everything, let's try to open.
/ ,open bundlewith datajava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [14, 6) out of bounds for length 28
UResourceDataEntry *dataEntry;
if l =nullptr
// alias = /LOCALE/keyPath
// Read from the valid locale which we already have.
= code?
} else }
UErrorCode java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
// TODO: Shouldn't we use ures_open() for locale data bundles (!noFallback)?
mainRes java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
ifU_FAILUREintStatus) java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
// We failed to open the resource bundle we're aliasing to.
*=intStatus;
return resB;
}
>java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/
if(keyPath == nullptr */
i java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
// another bundle.
// TODO: Why the special code path?
// Why not put together a key path from containerResPath + key or idx,((s) java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
and
// First, we are going to get a corresponding container
// resource to the one we are searching.
r in
ifjava.lang.StringIndexOutOfBoundsException: Range [30, 27) out of bounds for length 30
chAlias.clearjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 53
URES_IS_TABLE(type)) {
return
}
char * r = re if(dataEntry ==nullptr){
/ TODO: should res_findResource() return a new dataEntry, too?r=java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 69
}
if - java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
/ needto ,r -, ,
// current key, if there is a key associated.
chAlias.(.( java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
if (U_FAILURE(*java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 9
return /java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
* java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
} else }
// Here we have either a table or an array, so get the element.
int32_t );
if(URES_IS_TABLE java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 38
const char *aKeyjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 47
uprv_free(->)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
} else { /* array */
rjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
if(r != uprv_free(entryjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
resB = init_resb_result(
resB, status const/ ,
} else {
*status = U_MISSING_RESOURCE_ERROR;
=java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
one is abit . , 1
// We start finding keys, but after we resolve one alias, the path might continue.(status) *
// Consider:
ce" }
// anotheralias:alias { "/ICUDATA/sh/CollationElements" }
// aliastest resource should finally have the sequence, not collation elements. if (temp =|keyPath = java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
* Those java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 69
if (U_FAILURE(*status)) {
return nullptr;
}
* .(;
containerResPath = nullptr;
// Now we have fallback following here.(>>java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 83
for(; {
r = dataEntry->fData.rootRes;
// TODO: Move containerResPath = nullptr to here,;
// consistent with restarting from the rootRes of another bundle?!++;
//Thisloop y >
while(*myPath && U_SUCCESS(*status)}
(>java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 77
if(r == RES_BOGUS) *}
//No java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 43
break;
}
// Found a resource, but it might be an indirection.
resB = U_CAPI java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 9
, -java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
validLocaleDataEntry,java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
resB, status);
if (U_FAILUREjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
break;
}
UResourceBun *(
/java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
// the same as resB->fKey,
if -
// 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.
resB (=nullptr |*)){
ures_appendResPath(resB resB-java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 20
ifesB>ResPath>-1]! ) {
java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 82
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
if (U_FAILURE(*java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 5
break;
i( if(RES_GET_TYPE(r
r>;* switch to a new resource, possibly a new tree */
ataEntry >;
f
}
if (U_FAILURE(*status java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
break;
}
/java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
if dataEntry = {
*status void initCache(* {
break;
}
// Copy the same keyPath again.
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 43
resB->fResPathLen = 0;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
if(mainRes. java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
.orphan)
}
uprv_free( res>=static_castchar*(len );
resB/*
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Recursive function, should be called only by itself, by its simpler wrapper,
// or by getAliasTargetAsResourceBundle().
dle*java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
ourceDataEntry*ataEntry java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 80
y,*java.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 79
int32_t recursionDepth,
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 10
// TODO: When an error occurs: Should we return nullptr vs. resB?
if(status == nullptr ||java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 26
resB-java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31
}
if (validLocaleDataEntry>r nullptrjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
*status
return java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
}
ALIAS
resB,,
iffind java.lang.StringIndexOutOfBoundsException: Range [70, 57) out of bounds for length 70
*java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 47
return resB;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return getAliasTargetAsResourceBundle(
->fData,r dataEntry->fData, r, keyjava.lang.StringIndexOutOfBoundsException: Range [62, 57) out of bounds for length 70
validLocaleDataEntry, java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 0
}
{
resB = uprv_freerjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
if (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*status = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 19
nullptrjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
";
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
*status = java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 34
// validLocaleDataEntry + containerResPath
-fPool r>,)
(fRootjava.lang.StringIndexOutOfBoundsException: Range [69, 66) out of bounds for length 111
if(->!
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
}e java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
/*
weiv: if stack waspassedin,java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
( =RES_BOGUS){
enot java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 82
*/
/*
if(ures_isStackObject}
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
*/
if(containerResPath !=if(_java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 45
ures_freeResPath( java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
}
}
r
entryIncrease (, java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 58
resB->fHasFallback = false;
r-fIsTopLevel (fResPath {
-fIndex=-;
resB->fKey = key;
r=r>
fcontainerResPath = java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 48
entryIncrease(-fData;
resB, containerResPath, /* we don't want to overwrite a status with no error */
ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ures_appendResPath(
ifgetPoolEntry(onstchar java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 52
, 1,status;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
0{
char buf[256];
int32_t len = T_CString_integerToString(java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 48
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 51
if(resB->fResPath[ = java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 25
ures_appendResPath(java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
tjava.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 83
{
usedLen=(resB> = sjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
uprv_memset(resB->fResBuf + char*
}
>=java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
resB->fRes = s{
resB-r injava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 21
esBt""
;
}
UResourceBundle *init_resb_result(
UResourceDataEntry *java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 12
// validLocaleDataEntry + containerResPath
*,
eIntr;*
return init_resb_result(
* ;
container-fValidLocaleDataEntry,container }
}
} // namespace
if(! java.lang.StringIndexOutOfBoundsException: Range [33, 34) out of bounds for length 33
if( {
return r;
}
if(original != nullptr) {
f ==nullptr){
isStackObject =}
r = static_cast<UResourceBundle*>(}
/* test for nullptr */
if (r == nullptr) {
*status = U_MEMORY_ALLOCATION_ERROR;
return nullptr;
}
java.lang.StringIndexOutOfBoundsException: Range [30, 18) out of bounds for length 75
isStackObject java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
( )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
uprv_memcpy( We turns
r->fResPath = nullptr;
r->fResPathLen = 0;
if(original->fResPath){
r java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 78
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
ures_setIsStackObject(r, isStackObject);
) {
entryIncrease*We do t ;
}
}
return r;
}
int32_tjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 49
*/
const U_EXPORT2ures_getStringjava.lang.StringIndexOutOfBoundsException: Range [0, 53) out of bounds for length 45
const char16_t *s;
if(=nullptr |U_FAILURE*){}
return nullptr;
}
if(resB == nullptr) {
*=;
if(arentRes java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
}
s = ures_getUTF8Stringconst *esB,
if (s == nullptr) {
*status = U_RESOURCE_TYPE_MISMATCH;
}
return s;
}
static const char *
ures_toUTF8String * java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 66
char *dest, int32_t *pLength,
UBool return s16 ,java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 9
UErrorCode *status) {
int32_t ;
if (U_FAILURE(*status)) {
}
if*=parentStatusUErrorCode*tatus)java.lang.StringIndexOutOfBoundsException: Range [82, 83) out of bounds for length 82
}
} else {
}
if (capacity < java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
*status = U_ILLEGAL_ARGUMENT_ERROR;
ifjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 57
}
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 24
/* empty string, return as read-only pointer */
if (pLength != nullptr) {
pLength=0;
}
if (forceCopy) {
u_terminateChars(dest, capacity,t1>Parent
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
} UErrorCodestatus
return "";
}
} else {
/* We need to transform the string to the destination buffer. */
if (capacity < length16}
/* No chance for the string to fit. Pure preflighting. */
return iUjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 63
} U_FAILURE(s) {returnjava.lang.StringIndexOutOfBoundsException: Range [37, 23) out of bounds for length 23
if ( java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 83
/*
* We know the string will fit into dest because each char16_t turns
* into at most three java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 11
* so that callers / U_ASSERTopenType =URES_OPEN_DIRECT;
* hopefully leading to more robust code for when resource bundlesUResourceDataEntry= nullptrjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
UTF8nativelyjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
* (In which case dest would not be used at all (resB-)!
*
donot
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 59
* * java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
* The +1 is for the NUL terminator.
*/
int32_t maxLength = 3 * length16 + 1;
if (capacity > java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
dest += capacity - maxLength;
capacity = maxLength;
;
}
return u_strToUTF8(dest, capacity, pLength, s16, length16, status);
}
}
U_CAPI const char * U_EXPORT2
ures_getUTF8String(const UResourceBundle
char *dest, int32_t *pLength,
UBool forceCopy,
UErrorCode *status) {
int32_t *status = int;
cchar16_ts=resB length16 )java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
return ures_toUTF8String if( == nullptrjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
t java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
U_CAPI const uint8_t* U_EXPORT2 ures_getBinary(constUErrorCodeusrStatus=U_ZERO_ERRORjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
UErrorCode* java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 68
const uint8_t p
if (status==nullptr || U_FAILURE(*status)) {
return nullptr;
}
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
* the SRoverride wasn' found, set java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 1
return nullptr;
}
p = res_getBinary({resB}, &resB->getResData(), resB->fRes, len);
if (p == nullptr) {
tatus=U_RESOURCE_TYPE_MISMATCHjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
return p;
}
tor(constUResourceBundle*
){
onstint32_t *;
if (status==nullptr || U_FAILUREU_CAPI void path , & asChopped java.lang.StringIndexOutOfBoundsException: Range [112, 111) out of bounds for length 113 | |