Question

This is the flow of execution of my program in image form. I think these images were the next best thing to a video to adequately describe my problem.

  1. Nothing unusual happening here. Control is at the while loop and the keyPair is null.KeyPair is null

  2. The keyPair is still null even though the keyPairGen object called generateKeyPair().enter while loop

  3. The for loop was just another test to see if i could initialize the keyPair object. entering for loop to keep initializing keyPair

  4. Somehow, even though the keyPair is null, it is able to enter an if statement where the condition is specifically for the keyPair NOT being null. Somehow the keyPair is not null even though it is null

  5. Control goes back to the while loop after executing the break statement, which it shouldn't have. control goes back to while loop

  6. Even though the keyPair was null, the conditional statement in the while loop does not hold and control moves past the while loop, and the keyPair object is still null. control goes to next line of execution even though keyPair is still null

Why doesn't keyPair get initialized? I created a sandbox application and used the same code as in the images, and the keyPair object in my sandbox application is initialized.

Why do the conditional statements fail?

Note: I checked on another user's computer after he updated his working copy from svn, and he seemed to have the same problem as i did. We are using eclipse, java ee, jdk 7.

Was it helpful?

Solution

It is possible that eclipse may be giving you wrong information. However, trust the code - the conditional statements don't just fail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top