Object[] args, Map<String, Object> argsMap,
AppendableWrapper dest, FieldPosition fp) {
String msgString=msgPattern.getPatternString();
int prevIndex=msgPattern.getPart(msgStart).getLimit();
for(int i=msgStart+1;; ++i) {
Part part=msgPattern.getPart(i);
Part.Type type=part.getType();
int index=part.getIndex();
dest.append(msgString, prevIndex, index);
if(type==Part.Type.MSG_LIMIT) {
return;
}
prevIndex=part.getLimit();
if(type==Part.Type.REPLACE_NUMBER) {
if (stockNumberFormatter == null) {
stockNumberFormatter = NumberFormat.getInstance(ulocale);
}
dest.formatAndAppend(stockNumberFormatter, pluralNumber);
continue;
}
if(type!=Part.Type.ARG_START) {
continue;
}
int argLimit=msgPattern.getLimitPartIndex(i);
ArgType argType=part.getArgType();
part=msgPattern.getPart(++i);
Object arg;
String noArg=null;
Object argId=null;
if(args!=null) {
int argNumber=part.getValue(); // ARG_NUMBER
if (dest.attributes != null) {
// We only need argId if we add it into the attributes.
argId = Integer.valueOf(argNumber);
}
if(0<=argNumber && argNumber<args.length) {
arg=args[argNumber];
} else {
arg=null;
noArg="{"+argNumber+"}";
}
} else {
String key;
if(part.getType()==MessagePattern.Part.Type.ARG_NAME) {
key=msgPattern.getSubstring(part);
} else /* ARG_NUMBER */ {
key=Integer.toString(part.getValue());
}
argId = key;
if(argsMap!=null && argsMap.containsKey(key)) {
arg=argsMap.get(key);
} else {