Skip to content

Commit 1fedfb2

Browse files
committed
always enabled; remove unused var
1 parent b7d1b4e commit 1fedfb2

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

java/src/processing/mode/java/PreprocService.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ public class PreprocService {
9898
complete(null); // initialization block
9999
}};
100100

101-
private volatile boolean enabled = true;
102-
103101
/**
104102
* Create a new preprocessing service to support an editor.
105103
*/
@@ -178,15 +176,13 @@ public void cancel() {
178176
* Indicate to this service that the sketch code has changed.
179177
*/
180178
public void notifySketchChanged() {
181-
if (enabled) {
182-
synchronized (requestLock) {
183-
if (preprocessingTask.isDone()) {
184-
preprocessingTask = new CompletableFuture<>();
185-
// Register callback which executes all listeners
186-
whenDone(this::fireListeners);
187-
}
188-
requestQueue.offer(Boolean.TRUE);
179+
synchronized (requestLock) {
180+
if (preprocessingTask.isDone()) {
181+
preprocessingTask = new CompletableFuture<>();
182+
// Register callback which executes all listeners
183+
whenDone(this::fireListeners);
189184
}
185+
requestQueue.offer(Boolean.TRUE);
190186
}
191187
}
192188

@@ -243,7 +239,6 @@ private CompletableFuture<?> registerCallback(Consumer<PreprocSketch> callback)
243239
* {PreprocessedSketch} that has any {Problem} instances that were resultant.
244240
*/
245241
public void whenDone(Consumer<PreprocSketch> callback) {
246-
if (!enabled) return;
247242
registerCallback(callback);
248243
}
249244

@@ -259,7 +254,6 @@ public void whenDone(Consumer<PreprocSketch> callback) {
259254
* </p>
260255
*/
261256
public void whenDoneBlocking(Consumer<PreprocSketch> callback) {
262-
if (!enabled) return;
263257
try {
264258
registerCallback(callback).get(BLOCKING_TIMEOUT_SECONDS, TimeUnit.SECONDS);
265259
} catch (InterruptedException | ExecutionException | TimeoutException e) {

0 commit comments

Comments
 (0)