Fixing and Continuing feature for Java IDE?

M

mtczx232

I read that NetBean have it, I try simple main code:

public static void main(String[] args) {
// TODO code application logic here
int a=3;
a=9; <<<<<<<
}


I try to change the Value assignment to "a" at last line. and I realize
that no way to execute this line again. in short no way to step
reverse. so for this cases we need to change current value in watches
window and change the source code for next run. it's true?

but what we can do if have a complicate algorithm and have fix with
some parameters, how we suppost to use with this featurse?

I read about stack call, but I try this code:

static int aa(){
return 6;
}



public static void main(String[] args) {
// TODO code application logic here
int a=3;
a=9;
a=aa();
a=5;
}

but the call stack on run menu stil grayed and not available. and bad
from this, the debugger point to wrong line when i step into aa()
function?

Have some one to help? or have another group for NeBean
Maybe have some another IDE with this feature?

thanks
 
O

Oliver Wong

I read that NetBean have it, I try simple main code:

public static void main(String[] args) {
// TODO code application logic here
int a=3;
a=9; <<<<<<<
}


I try to change the Value assignment to "a" at last line. and I realize
that no way to execute this line again. in short no way to step
reverse. so for this cases we need to change current value in watches
window and change the source code for next run. it's true?

Most debuggers in most programming languages don't allow you to "step
backwards", or undo an operation. Imagine you wrote a CD burning program,
and you step over a function which burns data onto a CDR. You can't "step
back" to "unburn" the CD.

If all you want to do is change values of variables in memories, many
debuggers can do this. I don't use NetBeans, so I don't know what facilities
it provides, but in Eclipse, you can right click on the variable in the
"Variables" view, and select "Change value".
but what we can do if have a complicate algorithm and have fix with
some parameters, how we suppost to use with this featurse?

I read about stack call, but I try this code:

static int aa(){
return 6;
}



public static void main(String[] args) {
// TODO code application logic here
int a=3;
a=9;
a=aa();
a=5;
}

but the call stack on run menu stil grayed and not available. and bad
from this, the debugger point to wrong line when i step into aa()
function?

Have some one to help? or have another group for NeBean
Maybe have some another IDE with this feature?

I don't understand what you're asking, or what you're trying to do. I
don't know of any NetBeans specific newsgroup. Perhaps another reader here
can give you advice on NetBeans. Or you could try using Eclipse, and see if
it does what you want. Eclipse doesn't let you "step backwards" either
though. It does have a "drop frame" feature which essentially puts you back
to the beginning of the method you're currently running, but it doesn't undo
the side effects that may have occured so far (e.g. burning a CDR).

- Oliver
 
M

mtczx232

this features save lot of time for rapid developers. I not like
MS-Access or VS2005-VB but all my friends stuck with this product
because this lack on best tools like Eclipse.
 
D

dimitar

With IDEA you can change a class, reload it and pop to the caller frame,
so you can enter again and debug the new definition of the method.
Beware that any global state change will not be reverted (but then it's
the same for VB).

There is a limitation that you cannot change a method signature or
add/remove new method (same as VB). Theoretically this limitation is not
enforced by the specification, but I'm not aware of any JVM that would
support it.

The whole hot-swap + drop frame functionality is provided from JPDA and
is not IDE specific, which means that it should be available in any IDE
with half-decent debugger. You'd have to read the manual to figure how
to trigger it.

Dimitar
 
O

Oliver Wong

this features save lot of time for rapid developers. I not like
MS-Access or VS2005-VB but all my friends stuck with this product
because this lack on best tools like Eclipse.

You're saying MS-Access or VS2005-VB allows you to unburn a CDR? I'd be
very surprised.

If you want to change a class definition, and reload it and pop to the
caller frame, as dimitar mentioned, the IDEA IDE supports it, as does the
Eclipse IDE. To activate it in Eclipse, just make your changes in the Java
source code and save it. Eclipse will automatically recompile the code, and
make the hot-swap if it's possible.

- Oliver
 
T

Timo Stamm

dimitar said:
With IDEA you can change a class, reload it and pop to the caller frame,
so you can enter again and debug the new definition of the method.
Beware that any global state change will not be reverted (but then it's
the same for VB).

There is a limitation that you cannot change a method signature or
add/remove new method (same as VB). Theoretically this limitation is not
enforced by the specification, but I'm not aware of any JVM that would
support it.


I have heard that IBM VMs have better Hotswap support.
 
L

Larry Barowski

Timo Stamm said:
I have heard that IBM VMs have better Hotswap support.

If I remember correctly, this will be added/improved in
Sun's 1.6 VM/JDI API.
 
D

dimitar

Larry said:
If I remember correctly, this will be added/improved in
Sun's 1.6 VM/JDI API.

Does anybody know what will be added in 1.6? More preciselyly I'm
interested about:

* Private method addition to already loaded class (without overloading)
* Private method signature change/removal
* Non-private method addition (without overloading)
* Non-private method signature change/removal
* Superclass removal
 
I

IchBin

dimitar said:
Does anybody know what will be added in 1.6? More preciselyly I'm
interested about:

* Private method addition to already loaded class (without overloading)
* Private method signature change/removal
* Non-private method addition (without overloading)
* Non-private method signature change/removal
* Superclass removal

I have posted this before in this news group:

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/mustang/#Swing

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
T

Timo Stamm

IchBin said:


Hm, I can't find any mention of better hotswap support on this page.

It looks like JSR 292 will get us a step further in this regard, but it
won't be available before Java SE 7.

Hotswap support certainly is an important issue that has got a lot of
attention lately: http://forum.java.sun.com/thread.jspa?threadID=572396

Java will probably never be able to get rid of the write/debug cycle as
well as Smalltalk did, but it is obvious that the current hotswap could
be greatly improved.

I encourage to vote on RFE:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4910812


Timo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top