Hi All,
I have a method called to format data to a vector a certain way. Everything goes fine adding my format to a string myResults in j==3 if but when the code attempts to load the vector, acctResults.addElement(myResults);, I get a null pointer exception.
This is the call to the method:
Here is the called method:
Any suggestions/comments would be most appreciated.
TIA,
Tim
I have a method called to format data to a vector a certain way. Everything goes fine adding my format to a string myResults in j==3 if but when the code attempts to load the vector, acctResults.addElement(myResults);, I get a null pointer exception.
This is the call to the method:
Code:
...
formatedResults = getACHFormatedAccouts(results);
...
Here is the called method:
Code:
public Vector getACHFormatedAccouts(Vector _unFormattedAccts) throws ISCException {
Vector acctResults = null;
String myName = null;
String myID = null;
String myAchNbr = null;
String myResults = null;
int j = 0;
for(int i=0; i < _unFormattedAccts.size(); i++) {
j = j + 1;
if (j == 1) {
myName = (String)_unFormattedAccts.elementAt(i);
}
if (j == 2) {
myID = (String)_unFormattedAccts.elementAt(i);
}
if (j == 3) {
myAchNbr = (String)_unFormattedAccts.elementAt(i);
myResults = myName.trim() + " [" + myID.trim() + "] [" + myAchNbr.trim() + "]";
System.out.println("******myResults is ... " + myResults);
acctResults.addElement(myResults);
System.out.println("*****After results.addElement...");
j = 0;
}
}
return acctResults;
}
Any suggestions/comments would be most appreciated.
TIA,
Tim