Skip to content

Commit cf092d3

Browse files
committed
Small cleanup of NotificationManager
- Restored & improved NotifyJob comment (originally: NotificationJob) that was lost after refactoring in commit e9154ab - added "return" to allow easy debugging of the NotifyJob execution - don't init fields to defaults See eclipse-jdt/eclipse.jdt.core#4370
1 parent c98272e commit cf092d3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/NotificationManager.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,16 @@
4141
import org.eclipse.core.runtime.jobs.Job;
4242

4343
public class NotificationManager implements IManager, ILifecycleListener {
44+
45+
/**
46+
* Job for scheduling resource change notifications during nested workspace
47+
* operations if sufficient time (at least {@link #NOTIFICATION_DELAY}) has
48+
* elapsed.
49+
*/
4450
class NotifyJob extends Job {
4551
private final ICoreRunnable noop = monitor -> {
46-
// do nothing
52+
// do nothing, but keep return below for debugging
53+
return;
4754
};
4855

4956
public NotifyJob() {
@@ -98,11 +105,11 @@ public boolean belongsTo(Object family) {
98105
* tree the last time we computed a delta
99106
*/
100107
private volatile ElementTree lastDeltaState;
101-
protected volatile long lastNotifyDuration = 0L;
108+
protected volatile long lastNotifyDuration;
102109
/**
103110
* the marker change id at the end of the last POST_AUTO_BUILD
104111
*/
105-
private volatile long lastPostBuildId = 0;
112+
private volatile long lastPostBuildId;
106113
/**
107114
* The state of the workspace at the end of the last POST_BUILD
108115
* notification
@@ -111,7 +118,7 @@ public boolean belongsTo(Object family) {
111118
/**
112119
* the marker change id at the end of the last POST_CHANGE
113120
*/
114-
private volatile long lastPostChangeId = 0;
121+
private volatile long lastPostChangeId;
115122
/**
116123
* The state of the workspace at the end of the last POST_CHANGE
117124
* notification
@@ -120,7 +127,7 @@ public boolean belongsTo(Object family) {
120127

121128
private final ResourceChangeListenerList listeners;
122129

123-
protected volatile boolean notificationRequested = false;
130+
protected volatile boolean notificationRequested;
124131
private final Job notifyJob;
125132
private final Workspace workspace;
126133

0 commit comments

Comments
 (0)