Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <github@klug.nrw>
  • Loading branch information
J-N-K committed Jan 14, 2023
1 parent 389888b commit a103d6b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ public class DefaultScriptFileWatcher extends AbstractScriptFileWatcher {
private static final String FILE_DIRECTORY = "automation" + File.separator + "jsr223";

@Activate
public DefaultScriptFileWatcher(final @Reference(target = WatchService.CONFIG_WATCHER_FILTER) WatchService watchService
, final @Reference ScriptEngineManager manager,
final @Reference ReadyService readyService, final @Reference StartLevelService startLevelService) {
super(watchService, manager, readyService, startLevelService, FILE_DIRECTORY, true);
public DefaultScriptFileWatcher(
final @Reference(target = WatchService.CONFIG_WATCHER_FILTER) WatchService watchService,
final @Reference ScriptEngineManager manager, final @Reference ReadyService readyService,
final @Reference StartLevelService startLevelService) {
super(watchService, manager, readyService, startLevelService, FILE_DIRECTORY, true);
}

@Activate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ public class AbstractScriptFileWatcher implements WatchService.WatchEventListene

private volatile int currentStartLevel;

public AbstractScriptFileWatcher(final WatchService watchService, final ScriptEngineManager manager, final ReadyService readyService,
final StartLevelService startLevelService, final String fileDirectory, boolean watchSubDirectories) {
public AbstractScriptFileWatcher(final WatchService watchService, final ScriptEngineManager manager,
final ReadyService readyService, final StartLevelService startLevelService, final String fileDirectory,
boolean watchSubDirectories) {
this.watchService = watchService;
this.manager = manager;
this.readyService = readyService;
Expand Down Expand Up @@ -141,7 +142,7 @@ public void deactivate() {
readyService.unregisterTracker(this);

CompletableFuture.allOf(
Set.copyOf(scriptMap.keySet()).stream().map(this::removeFile).toArray(CompletableFuture<?>[]::new))
Set.copyOf(scriptMap.keySet()).stream().map(this::removeFile).toArray(CompletableFuture<?>[]::new))
.thenRun(scheduler::shutdownNow);
}

Expand Down Expand Up @@ -413,4 +414,4 @@ public void factoryRemoved(@Nullable String scriptType) {
.map(ScriptFileReference::getScriptIdentifier).collect(Collectors.toSet());
toRemove.forEach(this::removeFile);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ private AbstractScriptFileWatcher createScriptFileWatcher() {
}

private AbstractScriptFileWatcher createScriptFileWatcher(boolean watchSubDirectories) {
return new AbstractScriptFileWatcher(watchServiceMock, scriptEngineManagerMock, readyServiceMock, startLevelServiceMock, "", watchSubDirectories) {
return new AbstractScriptFileWatcher(watchServiceMock, scriptEngineManagerMock, readyServiceMock,
startLevelServiceMock, "", watchSubDirectories) {

@Override
protected ScheduledExecutorService getScheduler() {
Expand Down Expand Up @@ -682,4 +683,4 @@ public Future<?> submit(@NonNullByDefault({}) Runnable runnable) {
return super.submit(wrappedRunnable);
}
}
}
}

0 comments on commit a103d6b

Please sign in to comment.