Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 206725

Summary: Protect notification of build participants
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Jerome Lanneluc CLA 2007-10-18 04:58:02 EDT
I20071016-1215

A compiler participant that implements the build protocols may misbehave and throw RuntimeExceptions. We should wrap all the calls to CompilationParticipant's methods in a SafeRunnable. See sender of CompilationParticipant#reconcile(ReconcileContext) for an example.
Comment 1 Kent Johnson CLA 2007-10-18 14:32:50 EDT
The JavaBuilder is called from within a SafeRunnable already, so all the builder calls to the participant APIs will be caught/handled correctly.
Comment 2 Jerome Lanneluc CLA 2007-10-18 17:13:34 EDT
Looking at the senders of buildFinished(...), it looks like if a participant is throwing a RuntimeException, notifier.done() will never be called. Isn't that a problem ?


		for (int i = 0, l = this.participants == null ? 0 : this.participants.length; i < l; i++)
			this.participants[i].buildFinished(this.javaProject);
		if (!ok)
			// If the build failed, clear the previously built state, forcing a full build next time.
			clearLastState();
		notifier.done();
		cleanup();
	
Comment 3 Jerome Lanneluc CLA 2007-10-19 02:34:32 EDT
Also if the first particpant throws an exception, other participants will not be notified.
Comment 4 Kent Johnson CLA 2007-10-19 10:24:44 EDT
I would like to fail the build if a participant throws an Error.

And the overall build is wrapped in a SafeRunnable to catch such a case.

The alternative is potentially 100's errors reported from the same participant as we compile each file.
Comment 5 Eclipse Genie CLA 2019-12-12 11:10:41 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.