05-26-2009 10:38 AM
I've found what appears to be a bug on certain OS versions. I'll outline the steps to reproduce and hope someone can shed some light on the issue. Please help!
This bug was found on these OS versions:
Devices:
8320, 4.5.0.93
4.5.0.135
4.5.0.131
4.5.0.138
4.5.0.55
Don't know the model # for the last 4. Data is from customers.
Simulators:
8300, OS 4.5.0.44
9000, OS 4.6.0.92
No problem was found with these OS versions:
Devices:
8820, OS 4.2.2.193
8900, OS 4.6.1.231
8130, OS 4.3.0.97
9000, OS 4.6.0.167
Simulators:
8120, OS 4.3.0.59
8900, OS 4.6.1.92
8800, OS 4.2.1.89
Steps to reproduce:
Create a test contact in the Address Book with only the following information:
First: Frank
Last: Smith
Work: 1112223333
Be sure there is only one "Frank" in the address book. Now execute the following code:
BlackBerryContactList contactList = (BlackBerryContactList)PIM.getInstance().openPIMLi
Enumeration e = contactList.itemsByName("frank");
for (int j=0; e.hasMoreElements() ; ++j) {
Contact c = (Contact)e.nextElement();
int n = c.countValues(Contact.TEL); // returns 2 on red OS versions, 1 on green OSes
for (int i=0; i<n; ++i) {
String s = c.getString(Contact.TEL, i); // returns "1112223333" for both index 0 and 1
}
for (int i=0; i<n; ++i)
c.removeValue(Contact.TEL, 0); // throws IndexOutOfBounds exception when j == 1
break;
}
05-26-2009 10:48 AM
05-26-2009 12:45 PM