Java String.isEmpty interrupts method call or thread

lacike/ November 15, 2012/ Hints/ 0 comments

Does your call of String.isEmpty in your code cause strange behaviour such as:

– sudden interruption of method call (as if return was called)

– thread interruption

?

The problem is quite simple – you had build your code using JDK 1.6 with language compatibility set to previous version (1.4, 1.5) hoping the compiler would use the correct classes. This is, however, not true.

When you use the version switch the current JDK classes signatures are used. That means isEmpty is present as method of String class in 1.6. It is not present in previous releases.

Solution: Remove call of isEmpty and use the JDK you need without language compatibility to build against required version.

pošli na vybrali.sme.sk

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*

Blue Captcha Image
Refresh

*