Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7441073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:57:13+00:00 2026-05-29T10:57:13+00:00

We have an application on Java 6 running on Weblogic application server 11. I

  • 0

We have an application on Java 6 running on Weblogic application server 11. I am trying to debug an issue. My code is

if(a==0){
    //Do  A
}
else if(a==1){
    // Do B
}
else{
    // do C
}

My problem is that even if my if block is true and line 2 is executed still the debugger will go to line 8 in else block.
The code on my machine and on server are synched, so no mismatch.
Please help me finding what may be wrong with my code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:57:16+00:00Added an answer on May 29, 2026 at 10:57 am

    We need to know what does the // Do C.

    If there is an assignation:

    if (a == 0) {
          b = 1;
    } else  if (a == 1) {
          b = 0;
    }
    else {
          b = null;
    }
    

    a typical optimization that some compilers do would be:

    b = null;
    if (a == 0) {
        b = 1;
    } else if (a == 1) {
        b = 0;
    }
    

    And that is the bytecode executed. Let alone if the code is compiled to native by a JIT compiler.
    So depending on your debug client and jdk you could see crazy current instruction lines. But it is fine as long as the state at the end of the block is the expected.

    Sometimes the executions needs to close the statement. So it goes to the closing.

    Make sure that no static values is assigned to a and if so, that is recompiled. Assignations of static are linked in compile time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an issue related to a Java application running under a (rather old)
We have a java application which run as server running on a remote windows
We have a Java EE-based web application running on a Glassfish app server cluster.
I have an enterprise application running on a WebLogic server. When I modify any
We have a Java application server running on Sun Solaris. We now need to
We have several java application server running here, with several apps. They all log
We have a small java application running on windows that needs to be able
I have a running Java GWT application, that I can compile using Eclipse. Now
I have a Java application that authenticates against Active Directory. When running the program
I have a Java application that is running perfectly under windows, i go to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.