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 197751 - Step Into doesn't work in java.awt.Container().preferredSize()
Summary: Step Into doesn't work in java.awt.Container().preferredSize()
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-14 14:32 UTC by Jan Stola
Modified: 2011-04-16 08:38 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 Jan Stola 2011-04-14 14:32:31 UTC
Steps to reproduce:

1. Debug this line of code: new java.awt.Container().preferredSize();
2. Step Into preferredSize() method, the body of this method is

    	Dimension dim = prefSize;
    	if (dim == null || !(isPreferredSizeSet() || isValid())) {
	    synchronized (getTreeLock()) {
--->		prefSize = (layoutMgr != null) ?
		    layoutMgr.preferredLayoutSize(this) :
		    super.preferredSize();
                dim = prefSize;
            }
	}
        if (dim != null){
            return new Dimension(dim);
        }
        else{
            return dim;
        }

3. Step Over 3 times to get on the marked line.
4. Invoke Step Into. The debugger steps over instead.
Comment 1 Martin Entlicher 2011-04-14 15:24:46 UTC
Reproduced in a trivial program:

public class StepIntoConditionalTest implements Runnable {
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new StepIntoConditionalTest());
    }

    @Override
    public void run() {
        Container c = new Container();
        c.preferredSize();
    }
}
Comment 2 Martin Entlicher 2011-04-15 13:12:18 UTC
We took only the first method call into account and that was skipped because of the false condition.
Fixed by changeset:   192567:eec6ad978263
http://hg.netbeans.org/main/rev/eec6ad978263
Comment 3 Quality Engineering 2011-04-16 08:38:43 UTC
Integrated into 'main-golden', will be available in build *201104160401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/eec6ad978263
User: mentlicher@netbeans.org
Log: #197751 Find all next operation locations when we start with the first operation.