Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #16116 > unrolled thread

unreachable code

Started bybob smith <bob@coolfone.comze.com>
First post2012-07-19 14:50 -0700
Last post2012-07-19 16:15 -0700
Articles 7 — 7 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  unreachable code bob smith <bob@coolfone.comze.com> - 2012-07-19 14:50 -0700
    Re: unreachable code Arne Vajhøj <arne@vajhoej.dk> - 2012-07-19 18:02 -0400
    Re: unreachable code glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-07-19 22:04 +0000
    Re: unreachable code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-19 15:06 -0700
    Re: unreachable code Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-19 18:28 -0400
      Re: unreachable code Cecil Westerhof <Cecil@decebal.nl> - 2012-07-21 09:47 +0200
    Re: unreachable code Roedy Green <see_website@mindprod.com.invalid> - 2012-07-19 16:15 -0700

#16116 — unreachable code

Frombob smith <bob@coolfone.comze.com>
Date2012-07-19 14:50 -0700
Subjectunreachable code
Message-ID<09b77849-931d-46d9-b9b7-89441b81734e@googlegroups.com>
Is there an easy way to tell Java not to bug me about unreachable code?

[toc] | [next] | [standalone]


#16119

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-07-19 18:02 -0400
Message-ID<500883ec$0$288$14726298@news.sunsite.dk>
In reply to#16116
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

[toc] | [prev] | [next] | [standalone]


#16120

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2012-07-19 22:04 +0000
Message-ID<jua09d$ceh$2@speranza.aioe.org>
In reply to#16116
bob smith <bob@coolfone.comze.com> 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

[toc] | [prev] | [next] | [standalone]


#16121

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-07-19 15:06 -0700
Message-ID<kx%Nr.72959$l_1.46260@newsfe21.iad>
In reply to#16116
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.

[toc] | [prev] | [next] | [standalone]


#16123

FromEric Sosman <esosman@ieee-dot-org.invalid>
Date2012-07-19 18:28 -0400
Message-ID<jua1ml$atq$1@dont-email.me>
In reply to#16116
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
esosman@ieee-dot-org.invalid

[toc] | [prev] | [next] | [standalone]


#16178

FromCecil Westerhof <Cecil@decebal.nl>
Date2012-07-21 09:47 +0200
Message-ID<87pq7p4ku4.fsf@Compaq.site>
In reply to#16123
Op vrijdag 20 jul 2012 00:28 CEST schreef Eric Sosman:

> 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?

I am not the original poster, but it could be that he uses a system
that generates the code. I can understand that he think it is not nice
to comment out or delete the code every time it is generated again.
Bad generator of-course, but we do not always have a choice.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#16125

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-07-19 16:15 -0700
Message-ID<075h085m7d498bd9mhjb6tn5kmrl5f12sb@4ax.com>
In reply to#16116
On Thu, 19 Jul 2012 14:50:58 -0700 (PDT), bob smith
<bob@coolfone.comze.com> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web