Skip to content

Commit 8ec17fc

Browse files
committed
Simplify calls to Win32Monitor::setHandleValueArrays
- Remove parameter and obtain it inside the method instead (it was always the same parameter) - Reduce visibility of 2 methods
1 parent 5a6dfc4 commit 8ec17fc

File tree

1 file changed

+6
-6
lines changed
  • resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32

1 file changed

+6
-6
lines changed

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private void openHandleOn(String path, boolean subtree) {
221221
setHandleValue(createHandleValue(path, subtree, Win32Natives.FILE_NOTIFY_CHANGE_FILE_NAME | Win32Natives.FILE_NOTIFY_CHANGE_DIR_NAME | Win32Natives.FILE_NOTIFY_CHANGE_LAST_WRITE | Win32Natives.FILE_NOTIFY_CHANGE_SIZE));
222222
if (isOpen()) {
223223
fHandleValueToHandle.put(getHandleValue(), this);
224-
setHandleValueArrays(createHandleArrays());
224+
setHandleValueArrays();
225225
} else {
226226
close();
227227
}
@@ -369,7 +369,7 @@ public Win32Monitor(IRefreshResult result) {
369369
setPriority(Job.DECORATE);
370370
setSystem(true);
371371
fHandleValueToHandle = new HashMap<>(1);
372-
setHandleValueArrays(createHandleArrays());
372+
setHandleValueArrays();
373373
}
374374

375375
/**
@@ -424,7 +424,7 @@ private Handle createHandle(IResource resource) {
424424
* Win32Natives.MAXIMUM_WAIT_OBJECTS. The arrays are balanced so that they
425425
* differ in size by no more than one element.
426426
*/
427-
protected long[][] createHandleArrays() {
427+
private long[][] createHandleArrays() {
428428
long[] handles;
429429
// synchronized: in order to protect the map during iteration
430430
synchronized (fHandleValueToHandle) {
@@ -529,7 +529,7 @@ private void removeHandles(Collection<Handle> handles) {
529529
fHandleValueToHandle.remove(handle.getHandleValue());
530530
handle.destroy();
531531
}
532-
setHandleValueArrays(createHandleArrays());
532+
setHandleValueArrays();
533533
}
534534
}
535535

@@ -577,8 +577,8 @@ protected IStatus run(IProgressMonitor monitor) {
577577
return Status.OK_STATUS;
578578
}
579579

580-
protected void setHandleValueArrays(long[][] arrays) {
581-
fHandleValueArrays = arrays;
580+
private void setHandleValueArrays() {
581+
fHandleValueArrays = createHandleArrays();
582582
}
583583

584584
@Override

0 commit comments

Comments
 (0)