in src/main/java/org/apache/log4j/rule/InFixToPostFix.java [310:340]
private int handleText(String input, int pos, LinkedList linkedList) {
StringBuffer text = new StringBuffer("");
int newPos = pos;
while (newPos < input.length()) {
if (nextValueIs(input, newPos, " ")) {
linkedList.add(text);
return newPos;
}
if (nextValueIs(input, newPos, "(")) {
linkedList.add(text);
return newPos;
}
if (nextValueIs(input, newPos, ")")) {
linkedList.add(text);
return newPos;
}
for (Iterator iter = operators.iterator();iter.hasNext();) {
String operator = (String)iter.next();
if (nextValueIs(input, newPos, operator)) {
linkedList.add(text);
return newPos;
}
}
text.append(input.substring(newPos, ++newPos));
}
//don't add empty text entry (may be at end)
if (!text.toString().trim().equals("")) {
linkedList.add(text);
}
return newPos;
}