Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Question to Unreachable Code(Code is not reachable, but there's no warning)
Question to Unreachable Code [message #1451215] Thu, 23 October 2014 13:46 Go to next message
Antonio Bloise is currently offline Antonio BloiseFriend
Messages: 1
Registered: October 2014
Junior Member
Dear Eclipse Community,

i am not sure if this is a default setting or if this won't be reckognized as an unreachable code.
Using:
Eclipse Java EE IDE for Web Developers.
Version: Luna Release (4.4.0)
Build id: 20140612-0600
(and Versions below)

This is an example piece of code of the unreachable code:

String a = "";
if(a.isEmpty()) {
// a is always empty
} else if(a.contains("x")) {
// won't reach here
}

Do i oversee something, is it a bug or....?!

thanks and greetings.

I posted this under newcomer because this is my first post. greetings.
Re: Question to Unreachable Code [message #1451518 is a reply to message #1451215] Thu, 23 October 2014 23:59 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 10/23/2014 08:51 AM, Antonio Bloise wrote:
> Dear Eclipse Community,
>
> i am not sure if this is a default setting or if this won't be
> reckognized as an unreachable code.
> Using: Eclipse Java EE IDE for Web Developers.
> Version: Luna Release (4.4.0)
> Build id: 20140612-0600
> (and Versions below)
>
> This is an example piece of code of the unreachable code:
>
> String a = "";
> if(a.isEmpty()) {
> // a is always empty
> } else if(a.contains("x")) {
> // won't reach here
> }
>
> Do i oversee something, is it a bug or....?!
>
> thanks and greetings.
>
> I posted this under newcomer because this is my first post. greetings.

This has nothing to do with Eclipse. It's a Java question (and not a
bug, either). If you don't understand "unreachable code" please ask on a
forum like javaranch.com or stackoverflow.com.
Previous Topic:No Design view tab
Next Topic:Compatible computer platforms...
Goto Forum:
  


Current Time: Mon Oct 21 15:32:56 GMT 2019

Powered by FUDForum. Page generated in 0.03199 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top