Bug 544469 - Search Installed JREs is listing too many JREs
Summary: Search Installed JREs is listing too many JREs
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.11   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.11 RC1   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 543078
Blocks:
  Show dependency tree
 
Reported: 2019-02-15 04:15 EST by Noopur Gupta CLA
Modified: 2019-05-15 04:06 EDT (History)
6 users (show)

See Also:
daniel_megert: pmc_approved+


Attachments
Screenshot (284.90 KB, image/png)
2019-02-15 04:15 EST, Noopur Gupta CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2019-02-15 04:15:32 EST
Created attachment 277582 [details]
Screenshot

I20190215-0055

Searching for JREs is listing too many JREs as shown in the attached screenshot. It also shows the folder contents where I am searching for JREs and the result after the search.

Earlier, it used to search and list only one JRE per JDK version from the same folder on my disk.
Comment 1 Andrey Loskutov CLA 2019-02-15 04:27:07 EST
Most likely side effect of the recent changes via bug 543078.
Comment 2 Sarika Sinha CLA 2019-02-15 05:28:47 EST
Yes, this is expected. 
There are jres under fastdebug folders as well. 

And we need to search in the current folder also as the file structure has changed after Java 9.
Comment 3 Noopur Gupta CLA 2019-02-15 06:26:07 EST
I am not aware of the fastdebug use case, but as can be seen in the screenshot, for example, it now gives me 4 entries for JDK 8 folder (including the fastdebug stuff). Do we have 4 different JREs in JDK 8 and do all need to be listed here?
Comment 4 Dani Megert CLA 2019-02-15 08:58:25 EST
(In reply to Noopur Gupta from comment #3)
> I am not aware of the fastdebug use case, but as can be seen in the
> screenshot, for example, it now gives me 4 entries for JDK 8 folder
> (including the fastdebug stuff). Do we have 4 different JREs in JDK 8 and do
> all need to be listed here?
No, I don't think this helps users. Also two issues with the new behavior:
1. It takes much longer.
2. Since Search not only searches but directly adds them (a bug in my opinion) I have to manually delete things.
==> a better/smarter search algorithm needs to be implemented
Comment 5 Sarika Sinha CLA 2019-02-18 01:10:09 EST
All Oracle JREs have fastdebug jres. IBM and OpenJ9 JREs don't have it.

Before the fix from bug 543078, if we select the folder for search which directly has jre and fastdebug it was adding 2 jres.
Comment 6 Noopur Gupta CLA 2019-02-18 01:42:28 EST
(In reply to Sarika Sinha from comment #5)
> All Oracle JREs have fastdebug jres. IBM and OpenJ9 JREs don't have it.
> 
> Before the fix from bug 543078, if we select the folder for search which
> directly has jre and fastdebug it was adding 2 jres.
I think the first step should be to reduce them from 4 to 2 now to remove the extra entries for IBM ones also.

Searching for the fastdebug JREs can be done if they are useful here.
Comment 7 Dani Megert CLA 2019-02-18 02:44:05 EST
(In reply to Noopur Gupta from comment #6)
> (In reply to Sarika Sinha from comment #5)
> > All Oracle JREs have fastdebug jres. IBM and OpenJ9 JREs don't have it.
> > 
> > Before the fix from bug 543078, if we select the folder for search which
> > directly has jre and fastdebug it was adding 2 jres.
> I think the first step should be to reduce them from 4 to 2 now to remove
> the extra entries for IBM ones also.
> 
> Searching for the fastdebug JREs can be done if they are useful here.
We could either add a 'fastdebug' filter to the search or the preference page.
Comment 8 Dani Megert CLA 2019-02-18 02:45:15 EST
(In reply to Dani Megert from comment #7)
> (In reply to Noopur Gupta from comment #6)
> > (In reply to Sarika Sinha from comment #5)
> > > All Oracle JREs have fastdebug jres. IBM and OpenJ9 JREs don't have it.
> > > 
> > > Before the fix from bug 543078, if we select the folder for search which
> > > directly has jre and fastdebug it was adding 2 jres.
> > I think the first step should be to reduce them from 4 to 2 now to remove
> > the extra entries for IBM ones also.
> > 
> > Searching for the fastdebug JREs can be done if they are useful here.
> We could either add a 'fastdebug' filter to the search or the preference
> page.

> 2. Since Search not only searches but directly adds them (a bug in my opinion)
We could actually show a search result page before adding them automatically, and on that page we allow to filter/deselect the 'fastdebug' JREs.
Comment 9 Sarika Sinha CLA 2019-02-18 03:29:58 EST
I think showing the whole list and then letting the user select might help the user to chose between the jdk executable path of JDK or JRE  (but it will not have importance in future after Java 8 is sunset).

Right now we just ignore the java executable path of any other JRE and auto select the JDK one.
Comment 10 Lakshmi P Shanmugam CLA 2019-02-18 05:49:37 EST
I think we could have a checkbox preference on the Installed JREs page itself, something like "Don't look for inner/additional JREs" which is checked by default. Search will search based on this preference.
Comment 11 Pradeep Balachandran CLA 2019-02-19 03:17:04 EST
The new behavior is what I expect out of a search operation without any filter. In  this case, it should find all the possible JREs / JDKs. 

Even before the change in bug 543078, I was always getting 'fastdebug' when searching from that folder.  

> We could actually show a search result page before adding them automatically ...

Yes, that's a good idea. 

As a user, I expect the present behavior to be the default. The filter could provide various choices in a way that will be helpful to prune the search result to align with the context. The set of filter choices should be simple, helpful and not confusing.
Comment 12 Dani Megert CLA 2019-02-19 06:34:49 EST
Looking at this again a bit closer, we should simply fix bug 543078 by also searching in <installDir>/bin for Java 9 and beyond when the <installDir> is selected. Then continue to search in <installDir>/<anyfolder>/bin. That's how/why 'fastdebug' is found.

I assume the reason that the  Java 9 and beyond runtime is found when selecting a folder above <installDir>, is that it only looks in jre/bin and only if no runtime found there also in /bin. This is done for performance reasons.
Comment 13 Eclipse Genie CLA 2019-02-21 05:53:24 EST
New Gerrit change created: https://git.eclipse.org/r/137351
Comment 14 Sarika Sinha CLA 2019-02-21 06:10:53 EST
(In reply to Eclipse Genie from comment #13)
> New Gerrit change created: https://git.eclipse.org/r/137351

The change tries to keep the behavior like before bug 543078 and adds the feature to search for java executable if folder is selected as just above the bin folder.

finding fastdebug JREs and other JREs are also consistent to the previous behavior.
Comment 15 Dani Megert CLA 2019-02-21 11:29:04 EST
(In reply to Sarika Sinha from comment #14)
> (In reply to Eclipse Genie from comment #13)
> > New Gerrit change created: https://git.eclipse.org/r/137351
> 
> The change tries to keep the behavior like before bug 543078 and adds the
> feature to search for java executable if folder is selected as just above
> the bin folder.
> 
> finding fastdebug JREs and other JREs are also consistent to the previous
> behavior.
Perfect! Exactly how it should work.
Comment 16 Dani Megert CLA 2019-02-21 11:29:55 EST
+1 for RC1.
Comment 18 Sarika Sinha CLA 2019-02-27 05:14:55 EST
Verified using
Eclipse SDK

Version: 2019-03 (4.11)
Build id: I20190226-1800