Bug 70787

Summary: Compilation warning for IndexManager
Product: [Eclipse Project] JDT Reporter: Eugene Kuleshov <ekuleshov>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: All   
Whiteboard:

Description Eugene Kuleshov CLA 2004-07-25 00:02:43 EDT
There is a compilation warning for IndexManager when advanced features are enabled.

The field containerPath is defined in an inherited type and an enclosing
scope 	IndexManager.java
org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing	line
595	July 24, 2004 11:44:07 PM

I'd suggest to apply the following patch to change parameter name in
scheduleDocumentIndexing method or use explicit this.containerPath in line 595.

Index: IndexManager.java
===================================================================
RCS file:
/home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java,v
retrieving revision 1.129
diff -u -r1.129 IndexManager.java
--- IndexManager.java	21 Jul 2004 15:57:30 -0000	1.129
+++ IndexManager.java	25 Jul 2004 03:46:43 -0000
@@ -586,8 +586,8 @@
 	}
 	this.needToSave = !allSaved;
 }
-public void scheduleDocumentIndexing(final SearchDocument searchDocument, IPath
containerPath, final String indexLocation, final SearchParticipant
searchParticipant) {
-	request(new IndexRequest(containerPath, this) {
+public void scheduleDocumentIndexing(final SearchDocument searchDocument, IPath
contPath, final String indexLocation, final SearchParticipant searchParticipant) {
+	request(new IndexRequest(contPath, this) {
 		public boolean execute(IProgressMonitor progressMonitor) {
 			if (this.isCancelled || progressMonitor != null &&
progressMonitor.isCanceled()) return true;
Comment 1 Jerome Lanneluc CLA 2004-08-19 11:37:03 EDT
I'm not seeing this warning. Which advanced feature did you enable ? Which 
build are you using ?
Comment 2 Eugene Kuleshov CLA 2004-08-26 13:43:17 EDT
Currently I don't have this module around to verify, but it should be Java /
Compiller/ Advanced / Local variable declaration hides another field.

In this particular case it is even more confusing because there the same name is
used in parent class as well as in inner class.
Comment 3 Jerome Lanneluc CLA 2004-08-27 04:26:59 EDT
I have this warning turned on, but I'm not seeing any warning in IndexManager. 
What build number are you using ?
Comment 4 Eugene Kuleshov CLA 2004-08-29 23:52:27 EDT
That is strange. I just checked out this module from the HEAD again and tot the
same error: "The field containerPath is defined in an inherited type and an
enclosing scope". I noticed that I had JRE 1.3 compliance level in global
compiller settings. After changing compliance to JRE 1.4 and rebuild that error
turns into "Unqualified access to the field IndexRequest.containerPath".
Comment 5 Jerome Lanneluc CLA 2004-08-30 10:01:22 EDT
I see it now. Eclipse plugin are required to be compiled with 1.4 compliance 
level. That's why I didn't see it in the first place.
Comment 6 Jerome Lanneluc CLA 2004-09-07 12:00:36 EDT
Changed parameter name to 'container'.
Comment 7 David Audel CLA 2004-09-23 09:40:28 EDT
Verified in I200409240100.