Questions tagged [unreachable-code]

Unreachable code is part of the source code of a program which can never be executed because there exists no control flow path to the code from the rest of the program.

181 questions
0
votes
2 answers

"Unreachable Code Detected" Error Message in C#

I am trying to write a program in C# to find out if a number is a prime number. I use the first two if statements to single out many of the options, and then I am trying to nest a loop within the final else statement, and it tells me that there is…
FCain 1026
  • 59
  • 2
  • 6
0
votes
3 answers

Java:Unreachable statement error

for the following code mentioned below ,I have been obtaining the Error " Unreachable statement error " at " Return Cols " statement The code computes the position of Maximum Dose in a generated Output CSV file public int getPosition() { …
DevanDev
  • 245
  • 2
  • 11
0
votes
1 answer

Unreachable code in varien/configurable.js Magento

I was taking a look at the Magento source file to try to understand why I can't move varien/configurable.js whithout throwing an error with another extension, so Google Closure Compiler to shrink it, but it returns an error at line…
Razorphyn
  • 1,314
  • 13
  • 37
0
votes
1 answer

ImageView inflater unreachable code

I'm trying to inflate ImageView but android says it's an unreachable code ImageView imageView = (ImageView) row.findViewById(R.id.imageV); and i have to remove it. Where is an error? package com.examples.listimage; import…
0
votes
2 answers

unreachable code detected XNA C#

im sorry if im writing in weird ways. pretty new to programming, going the first year so I figured i could use some help.. im trying to get an "End screen" in my group and i have no idea really how to do it. we have three levels and after the third…
0
votes
2 answers

Unreachable code in Eclipse Android

I'm really new in android and java, but im trying to make an android app. Im trying to make something were you can just type in your name and then it should view it by a push on a button. Eclipse is giving me the "unreachable code" error. I was…
Marekkk
  • 5
  • 3
0
votes
2 answers

TextView unreachable code

Here the code: package com.example.appbsp; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle…
pos1
  • 5
  • 1
0
votes
2 answers

Avoid actually/logically unreachable code in catch clause

I have an interface : public interface FileRepository { String insert(File file) throws IOException; // other methods ... } My implementation of insert(File file) uses local (to avoid concurrency problem) java.security.MessageDigester which…
ren78min
  • 66
  • 6
0
votes
1 answer

Unreachable return statement still throws error

I have this very simple code snippet: static String getInput() throws IOException{ if(in.ready()){ return in.readLine().trim(); } System.err.println("Please provide more input in order to execute the program."); System.exit(0); …
janDro
  • 1,426
  • 2
  • 11
  • 24
0
votes
2 answers

Unreachable code, if statement, in tic tac toe?

I am creating a tic tac toe game for my AP Computer Science class and so far it ran without error, or that the error was resolved with a simple fix. However, when I added an if statement to the program it continuously displayes an error stating…
0
votes
4 answers

unreachable statement error obtained using labeled break

Here, I want to take few lines as input until only '0' is entered in one of the lines. And print these lines in the reverse order of how they were input. Howver, I'm facing difficulty in usage of the labeled break. I'm getting the following…
vipulnj
  • 135
  • 1
  • 4
  • 9
0
votes
3 answers

Unreachable Code Detected C#

Im trying to Post an unlimited number of likes but looping the cookies and proxies based on the how many cookies are stored in the array. Apparently i++ is unreachable code. What is the reason for that? public void PostLikes() { PostLike postLike…
0
votes
2 answers

Unreachable Code at return START_STICKY;

I have an app I'm building however I've come across an error stating "Unreachable Code" after the line return START_STICKY; starting with if (Config.DEVELOPMENT) { and I'm not sure how this can be resolved so my source executes correctly. SOURCE…
user2533377
  • 45
  • 1
  • 2
  • 6
0
votes
3 answers

Can conditions with functions result in unreached code?

Sorry I couldn't think of a better way to formulate my question so it could be a duplicate. I appologize in advance. Normally I would test this myself but I am currently on a workstation where I can't program. Say we have the following code public…
Jordy
  • 1,816
  • 16
  • 29
0
votes
1 answer

ADT doesn't detect unreachable code

Got the following code in the activity: LinearLayout view = (LinearLayout) this.findViewById(R.id.viewid); Drawable drawable = getResources().getDrawable(R.drawable.drawableid); if (Build.VERSION.SDK_INT >= 16) …
alterionisto
  • 77
  • 1
  • 8