Warning vs. error

Posted by Samuel on Stack Overflow See other posts from Stack Overflow or by Samuel
Published on 2010-05-20T14:48:58Z Indexed on 2010/05/20 14:50 UTC
Read the original article Hit count: 215

Filed under:
|
|
|

I had an annoying issue, getting a "Possible loss of precision" error when compiling my Java program on BlueJ (But from what i read this isn't connected to a specific IDE).

I was surprised by the fact that the compiler told me there is a possible loss of precision and wouldnt let me compile/run the program. Why is this an error and not a warning saying you might loose precision here, if you don't want that change your code?

The program runs just fine when i drop the float values, it wouldn't matter since there is no point (e.g [143.08, 475.015]) on my screen.

On the other hand when i loop through an ArrayList and in this loop i have an if clause removing elements from the ArrayList it runs fine, just throws an error and doesn't display the ArrayList [used for drawing circles] for a fraction of a second. This appears to me as a severe error but doesn't cause (hardly) any troubles, while i wouldn't want to have such a thing in my code at all.

What's the boundary?

© Stack Overflow or respective owner

Related posts about warnings

Related posts about error