
Tim C. answered 06/22/19
Former math teacher - math, CS, and science tutor
No matter what the status code is, if isPresent is false, you're logging an error.
You're also logging an error when isPresent is true and the status code is neither 200 nor 404.
You're returning a newArrayList whenever isPresent is false and also when isPresent is true and the code is not 200.
if (!P || (S != 404 && S != 200))
{
Log();
return Lists.newArrayList();
}
else if (S == 404) // P and S==404
return Lists.newArrayList();
}
else // P and S == 200
{
// . . .
// . . .
// . . .
return someOtherList;
}