Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

code - no compile errors - no runtime errors - doesn't execute

michaelmmichaelm Member Posts: 6
Here I am cruising around, becoming a Java ex-spurt, and then the hammer falls.

Your help appreciated.

class one extends JFrame
{
DBClass db;
public one(DBClass dbIn)
{
db = dbIn;
}
private void process()
{
List temp = new ArrayList();
temp = db.getOldList(); ******This is not executed******
}
}

Execution passes over the starred code.

I access db.other methods with no problem.

Why won't it execute the starred code?

Any ideas?

Thanks,

Comments

  • NemiNemi Member Posts: 4
    How do you know it is not executed? Try putting a System.out.println in your db.getOldList() method and see if it is indeed entering that method and just not returning anything.

    : Here I am cruising around, becoming a Java ex-spurt, and then the hammer falls.
    :
    : Your help appreciated.
    :
    : class one extends JFrame
    : {
    : DBClass db;
    : public one(DBClass dbIn)
    : {
    : db = dbIn;
    : }
    : private void process()
    : {
    : List temp = new ArrayList();
    : temp = db.getOldList(); ******This is not executed******
    : }
    : }
    :
    : Execution passes over the starred code.
    :
    : I access db.other methods with no problem.
    :
    : Why won't it execute the starred code?
    :
    : Any ideas?
    :
    : Thanks,
    :
    :

  • michaelmmichaelm Member Posts: 6
    I single stepped in JBuilder and it didn't enter the method.



    : How do you know it is not executed? Try putting a System.out.println in your db.getOldList() method and see if it is indeed entering that method and just not returning anything.
    :
    : : Here I am cruising around, becoming a Java ex-spurt, and then the hammer falls.
    : :
    : : Your help appreciated.
    : :
    : : class one extends JFrame
    : : {
    : : DBClass db;
    : : public one(DBClass dbIn)
    : : {
    : : db = dbIn;
    : : }
    : : private void process()
    : : {
    : : List temp = new ArrayList();
    : : temp = db.getOldList(); ******This is not executed******
    : : }
    : : }
    : :
    : : Execution passes over the starred code.
    : :
    : : I access db.other methods with no problem.
    : :
    : : Why won't it execute the starred code?
    : :
    : : Any ideas?
    : :
    : : Thanks,
    : :
    : :
    :
    :

  • NemiNemi Member Posts: 4
    Hmm. Well, it can't just "not execute" a line of code. Did you use 'step over' or did you use 'step into' on that line? Forgive me if you already know this, but 'step over' just goes to the next line of code in the currently running method and 'step into' will go to the next line of code in the program, even if it is in another object/method. My guess is that you were using step over?

    : I single stepped in JBuilder and it didn't enter the method.
    :
    :
    :
    : : How do you know it is not executed? Try putting a System.out.println in your db.getOldList() method and see if it is indeed entering that method and just not returning anything.
    : :
    : : : Here I am cruising around, becoming a Java ex-spurt, and then the hammer falls.
    : : :
    : : : Your help appreciated.
    : : :
    : : : class one extends JFrame
    : : : {
    : : : DBClass db;
    : : : public one(DBClass dbIn)
    : : : {
    : : : db = dbIn;
    : : : }
    : : : private void process()
    : : : {
    : : : List temp = new ArrayList();
    : : : temp = db.getOldList(); ******This is not executed******
    : : : }
    : : : }
    : : :
    : : : Execution passes over the starred code.
    : : :
    : : : I access db.other methods with no problem.
    : : :
    : : : Why won't it execute the starred code?
    : : :
    : : : Any ideas?
    : : :
    : : : Thanks,
    : : :
    : : :
    : :
    : :
    :
    :

  • michaelmmichaelm Member Posts: 6
    Nope step into, F7 in JBuilder.

    Thanks for your help. I know it's probably something simple.

    Michael

    : Hmm. Well, it can't just "not execute" a line of code. Did you use 'step over' or did you use 'step into' on that line? Forgive me if you already know this, but 'step over' just goes to the next line of code in the currently running method and 'step into' will go to the next line of code in the program, even if it is in another object/method. My guess is that you were using step over?
    :
    : : I single stepped in JBuilder and it didn't enter the method.
    : :
    : :
    : :
    : : : How do you know it is not executed? Try putting a System.out.println in your db.getOldList() method and see if it is indeed entering that method and just not returning anything.
    : : :
    : : : : Here I am cruising around, becoming a Java ex-spurt, and then the hammer falls.
    : : : :
    : : : : Your help appreciated.
    : : : :
    : : : : class one extends JFrame
    : : : : {
    : : : : DBClass db;
    : : : : public one(DBClass dbIn)
    : : : : {
    : : : : db = dbIn;
    : : : : }
    : : : : private void process()
    : : : : {
    : : : : List temp = new ArrayList();
    : : : : temp = db.getOldList(); ******This is not executed******
    : : : : }
    : : : : }
    : : : :
    : : : : Execution passes over the starred code.
    : : : :
    : : : : I access db.other methods with no problem.
    : : : :
    : : : : Why won't it execute the starred code?
    : : : :
    : : : : Any ideas?
    : : : :
    : : : : Thanks,
    : : : :
    : : : :
    : : :
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.