{"record":{"id":"a376c8b0d436ef98","repo":"apache/beam","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/NoopLock.java","lineNumber":66,"sourceCode":"  @Override\n  public void lockInterruptibly() {}\n\n  @Override\n  public boolean tryLock() {\n    return true;\n  }\n\n  @Override\n  public boolean tryLock(long time, TimeUnit unit) {\n    return true;\n  }\n\n  @Override\n  public void unlock() {}\n\n  @Override\n  public Condition newCondition() {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n}\n","sourceCodeStart":48,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/NoopLock.java#L48-L69","documentation":"NoopLock is a no-op Lock implementation used where locking is unnecessary; it does not support condition variables, so newCondition() unconditionally throws UnsupportedOperationException. Conditions require real monitor/synchronization semantics the no-op lock cannot provide.","triggerScenarios":"Calling newCondition() on a NoopLock instance, typically obtained where Beam substitutes a lock-free lock.","commonSituations":"Code written against java.util.concurrent.locks.Lock that assumes full Lock semantics; refactoring code that used ReentrantLock to use NoopLock while still using await/signal.","solutions":["Stop using Condition with this lock; use other coordination primitives (CountDownLatch, BlockingQueue, CompletableFuture).","Swap NoopLock for ReentrantLock if condition support is genuinely needed.","Remove condition-based waiting if mutual exclusion is known to be unnecessary."],"exampleFix":"// before\nCondition c = noopLock.newCondition();\n// after\nReentrantLock lock = new ReentrantLock();\nCondition c = lock.newCondition();","handlingStrategy":"type-guard","validationCode":"if (lock instanceof NoopLock) throw new IllegalStateException(\"Condition not supported on NoopLock\");","typeGuard":"boolean supportsConditions(Lock l) { return !(l instanceof NoopLock); }","tryCatchPattern":"try { lock.newCondition(); } catch (UnsupportedOperationException e) { /* switch to latch/queue */ }","preventionTips":["Do not use NoopLock where await/signal semantics are required","Prefer java.util.concurrent primitives (CountDownLatch, SynchronousQueue) for coordination","Document lock requirements when abstracting over Lock"],"tags":["java","concurrency","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}