Bug 578907

Summary: null ISchedulingRule does not interrupt autobuild
Product: [Eclipse Project] Platform Reporter: Jörg Kubitz <jkubitz-eclipse>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.23   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Jörg Kubitz CLA 2022-02-22 11:19:47 EST
..but tries to lock.acquire() in WorkManager.checkIn()

In for example bug 546828 the workaround was to not use a null rule. But it should be more consistent for all operations: 
for rule null we could either
a) do not lock workspace
b) interrupt autobuild

variant b) seems to be less intrusive, but the javadoc of
Workspace.prepareOperation() clearly states:
"*If* a scheduling rule is supplied, this method will block until it is safe to run."

so according to that description a null rule should not block. But who knows how that is used for ~ 20 years.

For example SaveManager.addParticipant() clearly expects mutal exclusion by using a null rule.

proposal: b) + fix javadoc
Comment 1 Jörg Kubitz CLA 2022-02-22 11:22:57 EST
affects also the API IWorkspace.run()

"If no scheduling rule is supplied, there are no scheduling restrictions for this operation."