@@ -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