Given the following code
var cachedInt = new ArrayBlockingQueue<Integer>(xxxxx);
while(true){
while(cachedInt.offer(randomProvider.nextInt()));
latch.await();
}
Will the jvm eventually eliminate the while loop because it has no body or does it recognize the side effect of the condition and keep the loop in place?
No the jvm will not "optimize" your method call away. Your condition will run repeatedly until it returns false and the side effects will happen as normal.