while(true){
try
{
if(Calendar.DATE == X){
startTask();
}
long delay = timeUntilNextCheck();
Thread.sleep(delay);
}
catch (Throwable t)
{
}
}
I have a program that requires a specific task to run on a specific day of the month. After the task is run (Or if its not that day) the thread sleeps until tomorrow where it will check again.
However, I am getting a Dead code warning because part of the code is only ran on a specific day of the month.
I had a read up on what this warning is and I found that in some cases the compiler doesn't compile dead code. So my question is, will this always be compiled?