I'm testing this function, but it just doesn't want to return true. Here it is:
public boolean linesExist(){
return lines != null ? !lines.isEmpty() : false;
}
Just checks whether or not an arraylist has elements in it, pretty simple.
However, even when all the values are correct this function returns false. I have refactored it to the following for easier debugging, but the results are even more strange:
public boolean linesExist(){
if (this.lines != null) {
boolean linesExist = !this.lines.isEmpty();
return linesExist;
} else {
return false;
}
}
https://i.stack.imgur.com/rYdNT.gif
Here is a gif going line by line through the function, the bottom has the related values (they're also displayed next to the code while its running). As you can see, it goes into the first if, then hits the "return true" and THEN goes into the else to hit the "return false"
I'm stumped, if anyone has a suggestion on what to do that'd be great.
EDIT: forgot to post the gif, sorry. https://i.stack.imgur.com/rYdNT.gif
[FINAL EDIT]: the issue was with the ide, clean the build, restart the ide and everything should work