Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > unreachable code

Reply
Thread Tools

unreachable code

 
 
bob smith
Guest
Posts: n/a
 
      07-19-2012
Is there an easy way to tell Java not to bug me about unreachable code?
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      07-19-2012
On 7/19/2012 5:50 PM, bob smith wrote:
> Is there an easy way to tell Java not to bug me about unreachable code?


Why not simply outcomment the unreachable code?

Arne


 
Reply With Quote
 
 
 
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      07-19-2012
bob smith <(E-Mail Removed)> wrote:
> Is there an easy way to tell Java not to bug me about unreachable code?


How unreachable is it?

As I understand it, the compiler is supposed to understand

if(false) { code }

and even

public static final boolean debug=false;

if(debug) code;

without complaint.

(That is, the Java replacement for C's

#if 0

#endif
)

-- glen
 
Reply With Quote
 
Daniel Pitts
Guest
Posts: n/a
 
      07-19-2012
On 7/19/12 2:50 PM, bob smith wrote:
> Is there an easy way to tell Java not to bug me about unreachable code?
>

Yes, you have several easy ways:

1. Make the code reachable.
2. Delete the unreachable code.
3. Surround the code which *causes* the unreachability with if(true){}
4. Comment out the unreachable code.

All of those will tell Java not to bug you about an obvious bug in your
code.

 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      07-19-2012
On 7/19/2012 5:50 PM, bob smith wrote:
> Is there an easy way to tell Java not to bug me about unreachable code?


"Delete it" comes to mind ...

Could you describe your situation in more detail? The
unreachable code will never be executed; why do you wish to
keep it around? I assume you've got some better reason than
"I admire the sheer beauty of useless clutter;" what is it?

--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)d
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-19-2012
On Thu, 19 Jul 2012 14:50:58 -0700 (PDT), bob smith
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone
who said :

>Is there an easy way to tell Java not to bug me about unreachable code?


Most IDES have a way to with a keystroke comment the code out. That
way it is easy to revive it later, but has no effect on the class
file.
--
Roedy Green Canadian Mind Products
http://mindprod.com
The greatest shortcoming of the human race is our inability to understand the exponential function.
~ Dr. Albert A. Bartlett (born: 1923-03-21 age: 89)
http://www.youtube.com/watch?v=F-QA2rkpBSY


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reliably call code after object no longer exists or is "unreachable"? Jack Bates Python 2 04-28-2011 07:13 AM
unreachable code? Gernot Frisch C++ 4 04-27-2006 09:19 PM
Routing issue Net Unreachable David Culliton Cisco 0 11-10-2004 08:43 PM
Cisco Student VPN exercise problem : gen_unrfrag: fail to generate unreachable, unexpected args robert Cisco 0 06-02-2004 07:33 PM
Destination Unreachable when trying SMTP from behind a PIX 501 MyndPhlyp Cisco 12 12-16-2003 09:27 PM



Advertisments