on 10-07-2013 8:43 PM
Hi
I need some help in remove surpress for the field Tel number. I am getting the result from if else condition output as per the screen shot attached I tried to use the following code but getting nullpointer exception
Argument -Input String[]
result Resultlist
for(int i=0;i<Input.length;i++)
{
if(!(Input[i].equals(ResultList.SUPPRESS)))
{
result.addValue(Input[i]);
}
Hi Mahesh,
Please modify your code as below
for(int i=0;i<Input.length-1;i++)
{
if(!(Input[i].equals(ResultList.SUPPRESS)))
{
result.addValue(Input[i]);
}
Regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
it is no surprise that you get a NullPointerException, since SUPPRESS is actually a synonyme for "null". So when you try to assign the value to the result list, you try to access an element that is in fact null. Hence the exception.
As Adarsh said, a RemoveContext would solve that issue in this case. If you could get multiple TelNr here, you might get into trouble with RemoveContext. That depends on the input data you get and the result you need to deliver.
Regards,
Jörg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.