{"record":{"id":"c6783462f26492d5","repo":"apache/beam","slug":"should-not-call-getcontinuationtrigger-list-trigger","errorCode":null,"errorMessage":"Should not call getContinuationTrigger(List<Trigger>)","messagePattern":"Should not call getContinuationTrigger\\(List<Trigger>\\)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/AfterWatermark.java","lineNumber":118,"sourceCode":"    public AfterWatermarkEarlyAndLate withLateFirings(OnceTrigger lateTrigger) {\n      return new AfterWatermarkEarlyAndLate(earlyTrigger, lateTrigger);\n    }\n\n    @Override\n    public <OutputT> OutputT accept(TriggerVisitor<OutputT> visitor) {\n      return visitor.visit(this);\n    }\n\n    @Override\n    public Trigger getContinuationTrigger() {\n      return new AfterWatermarkEarlyAndLate(\n          earlyTrigger.getContinuationTrigger(),\n          lateTrigger == null ? null : lateTrigger.getContinuationTrigger());\n    }\n\n    @Override\n    protected Trigger getContinuationTrigger(List<Trigger> continuationTriggers) {\n      throw new UnsupportedOperationException(\n          \"Should not call getContinuationTrigger(List<Trigger>)\");\n    }\n\n    @Override\n    public Instant getWatermarkThatGuaranteesFiring(BoundedWindow window) {\n      // Even without an early or late trigger, we'll still produce a firing at the watermark.\n      return window.maxTimestamp();\n    }\n\n    /** Returns true if there is no late firing set up, otherwise false. */\n    @Override\n    public boolean mayFinish() {\n      return lateTrigger == null;\n    }\n\n    @Override\n    public String toString() {\n      StringBuilder builder = new StringBuilder(TO_STRING);","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/AfterWatermark.java#L100-L136","documentation":"AfterWatermark's continuation trigger computation intentionally does not use the generic getContinuationTrigger(List<Trigger>) path; it builds continuations from its early/late sub-triggers directly. Calling the list-based method is a programming error, so Beam throws UnsupportedOperationException with this message.","triggerScenarios":"Calling getContinuationTrigger(List<Trigger>) on an AfterWatermark instance directly, or via reflection/framework code that invokes the protected generic path instead of getContinuationTrigger().","commonSituations":"Custom trigger frameworks iterating triggers and calling the generic continuation API; subclassing Trigger and reusing AfterWatermark in code paths that expect the list-based method to work; testing trigger internals.","solutions":["Call the no-argument getContinuationTrigger() instead; AfterWatermark composes early/late continuations itself","Remove custom code that invokes the protected List-based method; it's not part of AfterWatermark's supported API","If you need the combined continuation, use AfterWatermark.pastEarlyAndLateTriggers(...).getContinuationTrigger()","When writing generic trigger utilities, special-case AfterWatermark or rely on the public continuation API"],"exampleFix":"// before\nTrigger cont = afterWatermark.getContinuationTrigger(List.of(cont1, cont2));\n\n// after\nTrigger cont = afterWatermark.getContinuationTrigger();","handlingStrategy":"type-guard","validationCode":"// Use only the public continuation API\nif (trigger instanceof AfterWatermark) {\n  Trigger cont = ((AfterWatermark) trigger).getContinuationTrigger();\n}","typeGuard":"static Trigger safeContinuation(Trigger t) {\n  return t instanceof AfterWatermark\n      ? ((AfterWatermark) t).getContinuationTrigger()\n      : t.getContinuationTrigger();\n}","tryCatchPattern":"try {\n  trigger.getContinuationTrigger();\n} catch (UnsupportedOperationException e) {\n  // switch to the no-arg getContinuationTrigger()\n}","preventionTips":["Never call the protected List-based getContinuationTrigger directly","In generic trigger utilities, branch on the concrete trigger type","Rely on Trigger.getContinuationTrigger() (no-arg) as the public contract"],"tags":["java","apache-beam","triggers","watermark","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"}