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 68840 - An overriden method overriding with subclass of return type is instrumented twice
Summary: An overriden method overriding with subclass of return type is instrumented t...
Status: NEW
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-16 18:35 UTC by _ alexlamsl
Modified: 2011-10-05 17:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
bug (Profiler M10, NB5 Beta 2) (93.28 KB, image/png)
2005-11-16 18:36 UTC, _ alexlamsl
Details
CPU snapshot (21.63 KB, application/octet-stream)
2005-11-16 19:07 UTC, _ alexlamsl
Details
source files to reproduce the problem (1.87 KB, application/x-compressed)
2005-11-16 19:08 UTC, _ alexlamsl
Details
hopefully the correct source files (3.21 KB, application/x-compressed)
2005-11-21 18:01 UTC, _ alexlamsl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ alexlamsl 2005-11-16 18:35:16 UTC
Attached is the screen shot of the problem. I noticed this because when I 
select the lower entry the focus will "automatically" put back up on the upper 
entry.
Comment 1 _ alexlamsl 2005-11-16 18:36:05 UTC
Created attachment 27008 [details]
bug (Profiler M10, NB5 Beta 2)
Comment 2 _ alexlamsl 2005-11-16 18:37:54 UTC
Oh btw, it is an "Analyze Performance" on "Entire Application" with 
Filter "Exclude Java Core Classes"
Comment 3 Jiri Sedlacek 2005-11-16 18:42:28 UTC
Thanks for the report. Could you please attach the CPU snapshot with double 
entries so we can analyze the cause? If possible, please provide sample code 
which reproduces this bug.
Comment 4 _ alexlamsl 2005-11-16 19:05:44 UTC
Attached is the source for reproducing the problem and the snapshot taken as 
requested.

To reproduce the problem, profile the application as described above; open 
and "Live Results" window, then on the main application JFrame repeatly click 
on the upper "Add" button until you see the 2 "getElementAt(int)" results come 
up in the rank.
Comment 5 _ alexlamsl 2005-11-16 19:07:31 UTC
Created attachment 27009 [details]
CPU snapshot
Comment 6 _ alexlamsl 2005-11-16 19:08:00 UTC
Created attachment 27010 [details]
source files to reproduce the problem
Comment 7 ehucka 2005-11-21 15:42:19 UTC
It seems there is missing the MainPanel.java in the attached archive.
Comment 8 _ alexlamsl 2005-11-21 17:59:40 UTC
oh... sugar

attached the wrong file - thx for reminding ;)

*try again*
Comment 9 _ alexlamsl 2005-11-21 18:01:26 UTC
Created attachment 27111 [details]
hopefully the correct source files
Comment 10 iformanek 2005-11-23 18:26:43 UTC
I can reproduce the problem, thanks for providing the sample app.
The problem seems to be that the method is tracked under two different 
jMethodIDs, still have to investigate why this is happening.

Adjusting the priority to reflect the seriousness of the issue.
Comment 11 iformanek 2005-12-11 02:38:55 UTC
Further investigation shows that:
- the problem happens with all 3 instrumentation schemes
- the root cause of the problem is the fact that the getElementAt method is for 
some reason instrumented twice - once as a root and once as a regular method. 
The two instrumentations call into profiler agent separately, resulting in two 
different records for the method.
Comment 12 iformanek 2005-12-11 02:54:37 UTC
The very root cause of this issue is the fact that the method in the 
implementation has a different return type than int prototype in the interface 
(String vs. Object). The profile engine does not treat this correctly if the 
method is also a root and would instrument the method twice.

Since the constellation of things leading to this is rare, and the resulting 
behavior is not erroneous in a fatal way, lowering the priority to P3.

We will not fix this in 1.0, since the fix is not trivial. Will fix in the 
second release.
Comment 13 _ alexlamsl 2005-12-11 05:18:07 UTC
thanks for identifying the root cause - although covariant return type has 
only started its life in Tiger, the use of it could become rather common - 
e.g. Object.clone()

maybe a workaround or even a warning jogged down somewhere in 1.0 would be 
desirable.
Comment 14 J Bachorik 2007-01-09 08:51:37 UTC
assigned for reevaluation on the trunk
Comment 15 J Bachorik 2011-10-05 17:37:59 UTC
changing component