This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 168707 - Step into fails to detect the nearest available source
Summary: Step into fails to detect the nearest available source
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-16 20:03 UTC by Filip Zamboj
Modified: 2009-11-12 09:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Zamboj 2009-07-16 20:03:30 UTC
Product Version: NetBeans IDE 6.7.1 RC (Build 200907150227)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02

Step into sometimes fails to detect the nearest available source file and stop in it.

In the scenario described below, when stepping into out.println("<head>"), source of println() is not available, since
'out' is an instance of com.sun.enterprise.web.connector.coyote.PECoyoteResponse$PECoyoteWriter. The nearest available
source is java.nio.CharBuffer which of wrap() method is reached by nested calls.

1. run sample "ServletExamples" 
2. place breakpoints on lines 41,45,49 in HelloWorldExample.java 
3. try to step into - I succeeded to step into on line 49 only 

Class where breakpoints were set extends HttpServlet
here X marks lines where breakpoint is set and I tried to step into. Y denotes place where I suceeded to step into. 

scenario: 
public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        ResourceBundle rb =
            ResourceBundle.getBundle("LocalStrings",request.getLocale());
X        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        out.println("<html>");
X       out.println("<head>");

	    String title = rb.getString("helloworld.title");

Y	    out.println("<title>" + title + "</title>");
Comment 1 Daniel Prusa 2009-07-23 15:47:42 UTC
reproducible
Comment 2 Vojtech Sigler 2009-11-12 06:31:26 UTC
Hmm, reproduced. There is sure something wrong. If I refresh the page (during one debugging session) debugger still fails to step into 'response.setContentType("text/html");' - the first X, but now it steps into 'out.println("<head>");' - the second X.

I would like this fixed in 6.8, so I'm making it P2.
Comment 3 Martin Entlicher 2009-11-12 09:40:41 UTC
Well, as I analyzed the behavior it seems to me O.K. The code in C2BConverter is quite complicated, therefore it's realistic that CharBuffer.wrap() is not called always. IMHO debugger works correctly in the sense that it steps through code that does not have source available and stops when it reaches code with source available.

But during testing this I've found another bug - when you succeed to step into and you do Step Over then, the program just resumes and stops on the next breakpoint. This is a bug.
Comment 4 Martin Entlicher 2009-11-12 09:59:08 UTC
Step Over fixed in changeset:   153319:8f7ff729854f
http://hg.netbeans.org/main/rev/8f7ff729854f