Bug 64170

Summary: Classpath reentrance protection is not thread-safe
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Philipe Mulet CLA 2004-05-26 12:52:55 EDT
Build 3.0M9

The following code for protecting reentering CP resolution should use a thread 
local to allow multiple thread to get an accurate value (and not an empty CP 
if calling at wrong time).

				IClasspathEntry[] infoPath = 
perProjectInfo.resolvedClasspath;
				if (infoPath != null && 
(returnResolutionInProgress || infoPath != RESOLUTION_IN_PROGRESS)) {
					if 
(JavaModelManager.CP_RESOLVE_VERBOSE) {
						if (infoPath == 
RESOLUTION_IN_PROGRESS) {
						    Util.verbose
("CPResolution: Reentering Raw Classpath Resolution for project: "+ 
this.getElementName() + "\n  will use empty classpath instead");  //$NON-NLS-1
$ //$NON-NLS-2$
						    new Exception("TRACE OF 
REENTERING CALL").printStackTrace(System.out);  //$NON-NLS-1$
						}
					}				
		
					return infoPath;
				}
Comment 1 Jerome Lanneluc CLA 2004-05-27 10:35:11 EDT
Changed JavaProject#getResolvedClasspath(boolean, boolean, boolean) to use a 
thread local HashSet (stored on the JavaModelManager). This set contains the 
Java projects whose classpath is being resolved.
Comment 2 Olivier Thomann CLA 2004-05-28 16:05:12 EDT
Jerome, could you please verify this one? I don't know exactly what I am suppose
to verify.
Comment 3 Jerome Lanneluc CLA 2004-05-31 17:24:26 EDT
Verified