Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 541479

Summary: [code mining] Binary references are not counted
Product: [Eclipse Project] JDT Reporter: Noopur Gupta <noopur_gupta>
Component: UIAssignee: Jeff Johnston <jjohnstn>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: azerr, daniel_megert, jjohnstn, lshanmug, mistria, sarika.sinha
Version: 4.10   
Target Milestone: 4.10 RC2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/133010
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=fc43b2a2b9a4c3999d0e1e1fc692609c439676a0
Whiteboard:
Bug Depends on: 529127    
Bug Blocks:    
Attachments:
Description Flags
Screenshot none

Description Noopur Gupta CLA 2018-11-23 01:08:56 EST
See the discussion in bug 541416 and its Gerrit patch.

Binary references are not counted in code minings. It was observed in class files but this might also be an issue with the source files.
Comment 1 Sarika Sinha CLA 2018-11-23 05:40:49 EST
@Dani,
Even I feel that including search in Binary references may slow down the Code Minings computation.

Should we have a preference to control it ?
Comment 2 Mickael Istria CLA 2018-11-23 05:44:40 EST
OR maybe we can clarify the labels in preference/code minings to say "reference in sources" or "implementations in sources"?
Comment 3 Noopur Gupta CLA 2018-11-23 05:49:24 EST
Created attachment 276671 [details]
Screenshot

(In reply to Noopur Gupta from comment #0)
> See the discussion in bug 541416 and its Gerrit patch.
> 
> Binary references are not counted in code minings. It was observed in class
> files 
> but this might also be an issue with the source files.

I can see the issue in source files also. 

Hence, the count indicates wrong value as clicking on the annotation opens the search view which shows the result from the binary files also. See attached screenshot.
Comment 4 Sarika Sinha CLA 2018-11-23 05:54:55 EST
As Lakshmi already mentioned this in another bug.

If it is searching only in Source, it needs to set the proper options so that it does not search in binaries for the search view as well.
Comment 5 Dani Megert CLA 2018-11-23 12:10:38 EST
If not all references can be shown, then this feature has to be removed before we ship 4.10. Nothing is worse than showing wrong information. It causes people not to trust the feature.

So far some people "feel" or "are afraid" that it will be slow. Please fix this bug and then we can see whether this is *really* the case.
Comment 6 Dani Megert CLA 2018-11-23 12:11:21 EST
(In reply to Sarika Sinha from comment #4)
> As Lakshmi already mentioned this in another bug.

Which bug?
Comment 7 Eclipse Genie CLA 2018-11-23 22:32:29 EST
New Gerrit change created: https://git.eclipse.org/r/133010
Comment 8 Sarika Sinha CLA 2018-11-24 01:29:22 EST
(In reply to Dani Megert from comment #6)
> (In reply to Sarika Sinha from comment #4)
> > As Lakshmi already mentioned this in another bug.
> 
> Which bug?

Bug 541398.
Comment 9 Lakshmi P Shanmugam CLA 2018-11-26 01:16:56 EST
(In reply to Sarika Sinha from comment #8)
> (In reply to Dani Megert from comment #6)
> > (In reply to Sarika Sinha from comment #4)
> > > As Lakshmi already mentioned this in another bug.
> > 
> > Which bug?
> 
> Bug 541398.

As mentioned in see https://bugs.eclipse.org/bugs/show_bug.cgi?id=541398#c0, the reference count is wrong when the "include all plug-ins from target in Java search" is enabled as that includes the results in the External plug-ins .

The search should use the same logic that is used for counting the references. It should not include matches in binaries or external plug-ins.
Comment 11 Sarika Sinha CLA 2018-12-03 05:25:28 EST
Looks good for RC2.