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.
[recent profiler sources], NB4.1: build number 200504111930, client on JDK1.5.0_03, profiled app running on provided JDK1.4.2. 1. Download, unpack and open the provided project in NetBeans. 2. Click on Profile (Main Project), Select "Code Fragment". 3. Select "Specify Code Fragment" and in the dialog select class "profilertestapp.Main" and lines 28-30. 4. Run profiling: the statistics says only 2 lines are instrumented (and the results got from Get Results suggest that only lines 28 and 29 were measured). 5. Stop profiling & begin a new one, and open the "Specify Code Fragment" dialog once again. 6. In the dialog, Whole Method radio button is selected, instead of Part of Method Code. 7. Select lines 28-31. 8. Run profiling: the statistics say there are 3 lines instrumented. The Get Results never returns any results. From step 4, it seems that the instrumentation code is added before start line and before end line (which is a bit strange to the user, I would await the last line to be covered as well). Step 8 has probably problems because the while loop ending at line 31 never ends, so the profiler never reaches the end of the profiling region. But these two facts mean that it is not possible to profile line 30.
Created attachment 21580 [details] Test application.
Misha, can you please take a look at this?
Ok, checked and observed the same behavior. Your explanation about item 8 is correct - that's how code fragment profiling is supposed to work. If the loop eventually terminated, essentially the whole time spent in this loop would be shown. The fact that line 30 is not selected needs to be fixed. Started working on that.
Fixed in M7. Since this actually revealed some pretty fundamental problems and thus required at least one fix in the general bytecode rewriting functionality, I would like to ask Jan to re-run all the tests he has just to make sure nothing is broken with instrumentation.
Verification of old issues.
Closing old issues.