Bug 368523

Summary: [index] Provide an API to validate a given index file
Product: [Eclipse Project] JDT Reporter: Satyam Kandula <satyam.kandula>
Component: CoreAssignee: Satyam Kandula <satyam.kandula>
Status: VERIFIED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, jarthana, srikanth_sankaran
Version: 3.8   
Target Milestone: 3.8 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Satyam Kandula CLA 2012-01-13 04:58:05 EST
As part of bug 356620 and bug 365446, users can specify the index file for a given jar. Users can specify the index file through UI (bug 364287). As part of this, an API is required to validate the index file.
Comment 1 Satyam Kandula CLA 2012-01-13 05:08:13 EST
Created attachment 209438 [details]
Proposed patch

Added new API JavaConventions.validateIndexFile(IPath jarLocation, URL indexURL) so that one can verify the index file is good.
Comment 2 Satyam Kandula CLA 2012-01-13 05:12:51 EST
Jay, Can you please review?
Comment 3 Deepak Azad CLA 2012-01-13 08:29:41 EST
(In reply to comment #1)
> Added new API JavaConventions.validateIndexFile(IPath jarLocation, URL
> indexURL) so that one can verify the index file is good.

Satyam, what sort of validation happens here..
- The API verifies that the indexURL indeed points to an index file? 
- Does the API also verify that the index file corresponds to the jar specified by jarLocation? If not, do you really need jarLocation ?
Comment 4 Jay Arthanareeswaran CLA 2012-01-13 08:44:40 EST
Satyam, some minor points/questions on the patch:

1. As Deepak mentioned, the jarLocation is not really used in this case.

2. The constant INDEX_FILE_NOT_ABLE_TO_READ can be better named, e.g.
UNREADABLE_INDEX_FILE

3. In the javadoc of the constants, we should have an empty line before @since.
I also noticed the previous two constants (one of them from me!) have the same
problem. May be we can fix them too, now.

4. ClasspathEntry being internal, the @since tag is not required.
Comment 5 Deepak Azad CLA 2012-01-16 04:08:05 EST
Since there is no UI, see bug 364287, there is no need for this API.