View | Details | Raw Unified | Return to bug 89281
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/Compiler.java (-3 / +5 lines)
Lines 221-227 Link Here
221
			}
221
			}
222
			// initial type binding creation
222
			// initial type binding creation
223
			lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction);
223
			lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction);
224
			this.addCompilationUnit(sourceUnit, parsedUnit);
224
			this.addCompilationUnit(parsedUnit);
225
225
226
			// binding resolution
226
			// binding resolution
227
			lookupEnvironment.completeTypeBindings(parsedUnit);
227
			lookupEnvironment.completeTypeBindings(parsedUnit);
Lines 248-257 Link Here
248
	}
248
	}
249
249
250
	protected void addCompilationUnit(
250
	protected void addCompilationUnit(
251
		ICompilationUnit sourceUnit,
252
		CompilationUnitDeclaration parsedUnit) {
251
		CompilationUnitDeclaration parsedUnit) {
253
252
254
		// append the unit to the list of ones to process later on
253
		// append the unit to the list of ones to process later on
254
		if (this.unitsToProcess == null) {
255
			this.unitsToProcess = new CompilationUnitDeclaration[1];
256
		}
255
		int size = unitsToProcess.length;
257
		int size = unitsToProcess.length;
256
		if (totalUnits == size)
258
		if (totalUnits == size)
257
			// when growing reposition units starting at position 0
259
			// when growing reposition units starting at position 0
Lines 296-302 Link Here
296
				}
298
				}
297
				// initial type binding creation
299
				// initial type binding creation
298
				lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
300
				lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
299
				this.addCompilationUnit(sourceUnits[i], parsedUnit);
301
				this.addCompilationUnit(parsedUnit);
300
				//} catch (AbortCompilationUnit e) {
302
				//} catch (AbortCompilationUnit e) {
301
				//	requestor.acceptResult(unitResult.tagAsAccepted());
303
				//	requestor.acceptResult(unitResult.tagAsAccepted());
302
			} finally {
304
			} finally {
(-)dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java (-9 / +11 lines)
Lines 179-185 Link Here
179
				}
179
				}
180
				// initial type binding creation
180
				// initial type binding creation
181
				this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
181
				this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
182
				addCompilationUnit(sourceUnit, parsedUnit);
182
				addCompilationUnit(parsedUnit);
183
				this.requestedSources.put(unitResult.getFileName(), sourceUnit);
183
				this.requestedSources.put(unitResult.getFileName(), sourceUnit);
184
			} finally {
184
			} finally {
185
				sourceUnits[i] = null; // no longer hold onto the unit
185
				sourceUnits[i] = null; // no longer hold onto the unit
Lines 507-520 Link Here
507
				problemFactory.monitor = null; // don't hold a reference to this external object
507
				problemFactory.monitor = null; // don't hold a reference to this external object
508
			}
508
			}
509
			// first unit cleanup is done by caller, but cleanup all enqueued requested units (not processed)
509
			// first unit cleanup is done by caller, but cleanup all enqueued requested units (not processed)
510
//			if (resolver != null) {
510
			if (resolver != null) {
511
//				for (int i = 1; i <  resolver.totalUnits; i++) { // could be more requested units
511
				for (int i = 1, max = resolver.totalUnits; i < max; i++) { // could be more requested units
512
//					CompilationUnitDeclaration parsedUnit = resolver.unitsToProcess[i];
512
					CompilationUnitDeclaration parsedUnit = resolver.unitsToProcess[i];
513
//					if (parsedUnit.scope != null) 
513
					if (parsedUnit.scope != null) {
514
//						parsedUnit.scope.faultInTypes(); // force resolution of signatures, so clients can query DOM AST
514
						parsedUnit.scope.faultInTypes(); // force resolution of signatures, so clients can query DOM AST
515
//					parsedUnit.cleanUp();
515
					}
516
//				}
516
					parsedUnit.cleanUp();
517
//			}
517
					resolver.unitsToProcess[i] = null;
518
				}
519
			}
518
		}
520
		}
519
	}
521
	}
520
	public static IBinding[] resolve(
522
	public static IBinding[] resolve(
(-)model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java (-2 / +14 lines)
Lines 107-112 Link Here
107
107
108
		if (unit != null) {
108
		if (unit != null) {
109
			this.lookupEnvironment.buildTypeBindings(unit, accessRestriction);
109
			this.lookupEnvironment.buildTypeBindings(unit, accessRestriction);
110
			this.addCompilationUnit(unit);
110
			this.lookupEnvironment.completeTypeBindings(unit);
111
			this.lookupEnvironment.completeTypeBindings(unit);
111
		}
112
		}
112
	}
113
	}
Lines 195-202 Link Here
195
			if (problemFactory != null)
196
			if (problemFactory != null)
196
				problemFactory.monitor = null; // don't hold a reference to this external object
197
				problemFactory.monitor = null; // don't hold a reference to this external object
197
			// NB: unit.cleanUp() is done by caller
198
			// NB: unit.cleanUp() is done by caller
198
			if (problemFinder != null && resetEnvironment)
199
			if (problemFinder != null) {
199
				problemFinder.lookupEnvironment.reset();			
200
				if (resetEnvironment) {
201
					problemFinder.lookupEnvironment.reset();
202
				}
203
				for (int i = 1, max = problemFinder.totalUnits; i < max; i++) { // could be more requested units
204
					CompilationUnitDeclaration parsedUnit = problemFinder.unitsToProcess[i];
205
					if (parsedUnit.scope != null) {
206
						parsedUnit.scope.faultInTypes(); // force resolution of signatures, so clients can query DOM AST
207
					}
208
					parsedUnit.cleanUp();
209
					problemFinder.unitsToProcess[i] = null;
210
				}
211
			}
200
		}
212
		}
201
	}
213
	}
202
214

Return to bug 89281