Bug 399098 - Allow supplying pre-built JDT indexes for a JRE
Summary: Allow supplying pre-built JDT indexes for a JRE
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.8.2+   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, noteworthy
Depends on:
Blocks:
 
Reported: 2013-01-25 10:31 EST by Troy Bishop CLA
Modified: 2013-03-19 10:28 EDT (History)
6 users (show)

See Also:


Attachments
possible patch (8.25 KB, patch)
2013-01-25 10:31 EST, Troy Bishop CLA
no flags Details | Diff
updated patch (10.00 KB, patch)
2013-02-08 12:14 EST, Michael Rennie CLA
no flags Details | Diff
possible testcase patch (4.45 KB, patch)
2013-02-21 15:45 EST, Troy Bishop CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Bishop CLA 2013-01-25 10:31:03 EST
Created attachment 226109 [details]
possible patch

In bug 356620 support was added in JDT to allow Eclipse-based products to supply pre-built indexes for classpath entries.  It is currently not possible to supply pre-built indexes for a JRE container and, in our Eclipse-based product, allowing this would help improve the performance by reducing the time it takes to index our JRE.  We have other function that depends on the index being complete so if a user were to invoke our function early then they would have to wait for the indexing to complete.

Attached is a patch which provides the necessary update to allow us to supply pre-built indexes for our JRE.

There are some minor things like @since and bundle version values that may need to be done.  I don't know the correct values you want for these fields.

This patch was created against the R3_8_mainteance branch as, I'm assuming, this is what feeds the 4.2 SR2 release and, ultimately, where I'm hoping this can be included (i.e. in some 4.2.x release).
Comment 1 Michael Rennie CLA 2013-02-08 12:14:05 EST
Created attachment 226791 [details]
updated patch

This is an updated patch with corrected since tags / copyright updates.

The patch is a good start, but a couple things come to mind as missing:

1. we should also be able to set the index paths from EE files - see ExecutionEnvironmentDescription

2. we should add a way to the installed JRE UI to set the location, like we do for all other lib location attributes - see VMLibraryBlock
Comment 2 Troy Bishop CLA 2013-02-08 19:45:02 EST
> 2. we should add a way to the installed JRE UI to set the location, like we
> do for all other lib location attributes - see VMLibraryBlock

The UI discussion for the pre-built indexes (not specific to the JRE) was discussed in bug 364287, but ultimately it was rejected.  Maybe this should be revisited if you think it's needed?
Comment 3 Michael Rennie CLA 2013-02-13 16:17:15 EST
Pushed updated patch + EE support + unit tests to master with:

http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=3b4cd0912c0e166337d78b6cc6f3dc643bf749a4

> ultimately, where I'm hoping this can be included (i.e. in some 4.2.x release)

I could put it in 4.2.2+ but there would be no more releases for 4.2.x after 4.2.2. Troy, would 4.2.2+ be ok, or would 4.3 suffice?

Also it would be good if you could supply me with an index file (or however they are stored) and an example of how the index is included so I can make some more regression tests for the new support.
Comment 4 Troy Bishop CLA 2013-02-13 20:15:34 EST
(In reply to comment #3)
> Pushed updated patch + EE support + unit tests to master with:
> 
> http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/
> ?id=3b4cd0912c0e166337d78b6cc6f3dc643bf749a4
> 
> > ultimately, where I'm hoping this can be included (i.e. in some 4.2.x release)
> 
> I could put it in 4.2.2+ but there would be no more releases for 4.2.x after
> 4.2.2. Troy, would 4.2.2+ be ok, or would 4.3 suffice?
> 

Yes, 4.2.2+ would be perfect.  Thank you!

> Also it would be good if you could supply me with an index file (or however
> they are stored) and an example of how the index is included so I can make
> some more regression tests for the new support.

I'll have a look at your existing testcases and see if I can come up with something to cover this testing... hopefully by end of this week.
Comment 5 Michael Rennie CLA 2013-02-14 09:23:11 EST
(In reply to comment #4)

> I'll have a look at your existing testcases and see if I can come up with
> something to cover this testing... hopefully by end of this week.

Wouldn't you look at *your* testcase so I can make some unit tests that mimic it? :)
Comment 6 Troy Bishop CLA 2013-02-21 15:45:47 EST
Created attachment 227424 [details]
possible testcase patch

Sorry for the delay... but here's a possible patch that tests the changes for this patch.  Let me know if you have any concerns with it, Thanks!
Comment 7 Michael Rennie CLA 2013-02-25 14:58:13 EST
(In reply to comment #6)
> Created attachment 227424 [details]
> possible testcase patch
> 
> Sorry for the delay... but here's a possible patch that tests the changes
> for this patch.  Let me know if you have any concerns with it, Thanks!

Thanks for the test Troy, I made some slight changes since the Oracle VM also has the javadoc_location classpath attribute that gets added, so originally the test was failing.

Pushed tests to master:

http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=23eac143248c0ae68aa5d8d673def802f5372a4a
Comment 8 Michael Rennie CLA 2013-02-27 14:57:54 EST
I found a problem with the new support: when cloning the library locations for a given VM install, we end up erasing the index location if it has been set. See  the JavaRuntime#getLibraryLocations(IVMInstall) API which causes the problem.

pushed fix + regression test to:

http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=63ec01831b3e1b65532b49210ffb0a339e5f1667