For some reason I have to change a method of one class of that API.
Now I want to know how this change affect on my project.
So I used F7 to go through the method .
But it doesn,t work, F7 acted like F8 in NetBeans6.8 !!
What should I do for debugging the methods of an API ?Using JunitTest is helpful here?
Thanks.
I also ask this question in this forum: Stackoverflow
Greg Brannon
Bartender
Joined: Oct 24, 2010
Posts: 530
posted
0
Please just post one thread per topic in this forum.
I suspect your question is specific to a development environment. When you say, "F7 acted like F8 here," what do you mean? Where's "here" and what are you comparing "here" to?
Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
4
posted
0
Once you have published that method as part of an API you must ensure its effects do not change. You can of course alter the implementation which achieves that effect.
Sara Bony
Greenhorn
Joined: May 18, 2012
Posts: 18
posted
0
Greg Brannon wrote:Please just post one thread per topic in this forum.
Ok. i edit my post.
What do you mean?
I searched in this forum, but there is no result.
Sara Bony
Greenhorn
Joined: May 18, 2012
Posts: 18
posted
0
Campbell Ritchie wrote:Once you have published that method as part of an API you must ensure its effects do not change. You can of course alter the implementation which achieves that effect.
Can you explain more?
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
4
posted
1
Which bit don’t you understand? If you are using that method in an API, you must maintain its effect. You can change the implementation, however. You will have given it a description in its documentation, so you are now bound to maintain the method to match that description.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
4
posted
0
On SO you were on about altering the method in an API you have downloaded. You can’t do that. You would have to write your own class.
Sara Bony
Greenhorn
Joined: May 18, 2012
Posts: 18
posted
0
Campbell Ritchie wrote:On SO you were on about altering the method in an API you have downloaded. You can’t do that. You would have to write your own class.
Ok.
But my main problem is :for understanding details about a method(in an API) and knowing how exactly it works, need to trace that method step by step, i use (f7 ,step into method) for doing that .
But it does not go into the method.
Sara Bony wrote:But my main problem is :for understanding details about a method(in an API) and knowing how exactly it works, need to trace that method step by step, i use (f7 ,step into method) for doing that .
But it does not go into the method.
OK, so this is something like Eclipse or Netbeans, right?
If you let us know exactly what, we could move your question to a more appropriate forum.
Winston
Isn't it funny how there's always time and money enough to do it WRONG?
Sara Bony
Greenhorn
Joined: May 18, 2012
Posts: 18
posted
0
Winston Gutkowski wrote:
Sara Bony wrote:But my main problem is :for understanding details about a method(in an API) and knowing how exactly it works, need to trace that method step by step, i use (f7 ,step into method) for doing that .
But it does not go into the method.
OK, so this is something like Eclipse or Netbeans, right?
If you let us know exactly what, we could move your question to a more appropriate forum.
Winston
Ok.
Program run in NetBeans 6.8.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
4
posted
0
Why do you need to know the implementation details of that method in the first place?
Sara Bony
Greenhorn
Joined: May 18, 2012
Posts: 18
posted
0
Campbell Ritchie wrote:Why do you need to know the implementation details of that method in the first place?
Because i need to change that to meet my requirement.
It is an API of a simulator, its developer developed it in general and users should change it to meet their special requirement.
Stuart A. Burkett
Ranch Hand
Joined: May 30, 2012
Posts: 322
posted
1
Sara Bony wrote:
Campbell Ritchie wrote:Why do you need to know the implementation details of that method in the first place?
Because i need to change that to meet my requirement.
It is an API of a simulator, its developer developed it in general and users should change it to meet their special requirement.
So you have the source code for the API. Have you told Netbeans where this source code is ? Netbeans (and other IDEs for that matter) can only step into the source code if they know where it is. If they don't know where it is then they will just step over the method call which appears to be what is happening here.
And before you ask, I don't know how to tell Netbeans where the source code is as I don't use Netbeans, but it shouldn't be difficult to find in the help.
Sara Bony
Greenhorn
Joined: May 18, 2012
Posts: 18
posted
0
The problem has been solved.
We can only do line-by-line debugging in NetBeans for a library (package) if we have the source code for that package, and for adding it in NeatBeans :
1. right click on project and go to "Properties"
2. in the window that appear choose "sources" on the left
3. on the right of window, under "source package folder" click on "add folder" then add the root directory for the source code.