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 151832

Summary: Debug steps are sometimes misleading
Product: debugger Reporter: shadewind <shadewind>
Component: JavaAssignee: issues@debugger <issues>
Status: CLOSED WONTFIX    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description shadewind 2008-10-30 10:39:33 UTC
for(ServiceInfo serviceInfo : services.values())
{
	if(type.isAssignableFrom(serviceInfo.getType()) && serviceInfo.hasServiceKey(key))
		return serviceInfo;
}

Consider debugging code snippet like the above example. When looping through it, even if the if-clause holds false, the
step cursor will "step on" the "return serviceInfo;" line anyway. This is confusing as it leads me to believe that the
if-clause actually held true when it didn't. The step cursor should land on the closing brace '}' instead if the
if-clause is skipped which would be a lot clearer.
Comment 1 Martin Entlicher 2008-10-30 15:20:45 UTC
I've reproduced the behavior. But this can not be fixed in NetBeans.
The locations where debugger stops are generated by compiler.
Comment 2 Martin Entlicher 2008-10-30 15:31:40 UTC
I've submitted a defect for javac compiler - 6765597.
Comment 3 Quality Engineering 2010-04-29 09:45:11 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.