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 79341 - "Step Over" on <import/> steps into the imported file
Summary: "Step Over" on <import/> steps into the imported file
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Ant (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-28 14:51 UTC by Jiri Kovalsky
Modified: 2012-10-22 16:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The NPE I got in console. (1.12 KB, text/plain)
2006-06-28 17:06 UTC, Martin Entlicher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2006-06-28 14:51:22 UTC
Development build #200606271800 of NetBeans 6.0
Windows XP, JDK 1.5.0_05 build #05 or JDK 1.6.0 RC build #87

Description:
============
Ant debugger steps into imported file if "Run|Step Over" is invoked from main
menu on line with e.g. <import file="build-impl.xml"/> code. This happens when
debugging targets with dependency on the imported targets.

Steps to reproduce:
===================
1. Download and unzip build scripts from here:
http://qa.netbeans.org/modules/debugger/promo-f/build-scripts.zip
2. Mount directory with the two XML files in Favourites view.
3. Right click build.xml filenode and invoke "Debug Target|Other Targets|run".
4. Once debugger stops at line 5 invoke "Run|Step Over" from main menu.
5. Debugger opens build-impl.xml file and stops at line 5.
6. Tha same does not occur when "Debug Target|all" is run.
Comment 1 Martin Entlicher 2006-06-28 17:05:39 UTC
Reproduced. Interestingly, I got a NPE in the console, which probably caused the
debugger to stop inside the imported file.
Comment 2 Jesse Glick 2006-06-28 17:06:17 UTC
IMHO the bug is in step #4, not step #5. An import statement is not supposed to
be an executable statement; it is a declaration. That is, the first statement to
stop on should be build-impl.xml:5, i.e. step #4 should be skipped but step #5
is correct.
Comment 3 Martin Entlicher 2006-06-28 17:06:31 UTC
Created attachment 31482 [details]
The NPE I got in console.
Comment 4 Martin Entlicher 2006-06-28 17:12:08 UTC
Jesse, IMHO there is also a problem in ANT, because build-impl.xml is not
recognized as an ANT file and therefore dobj.getCookie(AntProjectCookie.class)
gives null.
But $ ant compile -f build-impl.xml
works fine. So this should be corrected in ANT module.

Perhaps you're right with the import statement, but it's less user-friendly when
it goes inside automatically IMHO.
Comment 5 Jesse Glick 2006-06-28 17:16:29 UTC
build-impl.xml has no attrs on the <project> tag so it is not assumed to be an
Ant script. This is as designed. (Could be a Maven POM, etc.) If you have code
which expects an APC, do not rely on DataObject.getCookie. Use
TargetLister.getAntProjectCookie or equivalent (this should probably be made an
API sometime, feel free to file an RFE for it).
Comment 6 Jiri Kovalsky 2006-06-28 19:34:47 UTC
I agree that jumping into build-impl.xml:5 when debugging "run" target is very
user confusing. In my opinion Ant debugger should simply stop at "run" target
and that's it.
Comment 7 Martin Entlicher 2006-06-29 17:38:58 UTC
Jesse, TargetLister.getAntProjectCookie() is unfortunately package-private. I'll
file a RFE to make it public. Is there a workaround in the mean time?
getAntProjectCookie() caches the AntProjectCookie, so I guess creating new
AntProjectSupport(fo); if there is no dobj cookie is not a good approach.

IMHO the best is just to ignore the import statement as Jesse suggested and stop
right before "-pre-run" at "<target name="run" depends="-pre-run, compile">"
line.  It should go into build-impl.xml when I do Step Into on "compile" at that
line.
Comment 8 Jesse Glick 2006-06-29 17:40:19 UTC
Re. getAntProjectCookie - for now you can just copy the impl from TargetLister.
Comment 9 Lukas Hasik 2008-04-10 21:24:28 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 10 pgebauer 2009-01-14 09:35:35 UTC
The issue hasn't passed the nomination process for 65patch2 by cut-off date. It has been moved to 65patch3.
Comment 11 pgebauer 2009-04-08 14:05:35 UTC
The status whiteboard "65fixes4-candidate" has been removed.
At this time our proactive patches for the NetBeans 6.5.x IDE have concluded.

If you own a Sun service plan contract for NetBeans, you may wish to contact
Sun Service http://www.sun.com/contact/support.jsp to request a fix via the
product defect escalation process.

For more information on purchasing a Sun service plan contract for NetBeans,
refer to the service plan item "Sun Software Service Plans (S3P) for Developers"
in the Sun Service table found on our NetBeans Support Resources
page http://www.netbeans.org/kb/support.html