{"record":{"id":"1e31ebdab5b9001e","repo":"apache/beam","slug":"boundedwindow-unsupported-in-s","errorCode":null,"errorMessage":"BoundedWindow unsupported in %s","messagePattern":"BoundedWindow unsupported in (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java","lineNumber":420,"sourceCode":"      throw new UnsupportedOperationException(\n          String.format(\"MultiOutputReceiver unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public Object restriction() {\n      throw new UnsupportedOperationException(\n          String.format(\"Restriction unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public BoundedWindow window() {\n      throw new UnsupportedOperationException(\n          String.format(\"BoundedWindow unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public PaneInfo paneInfo(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"PaneInfo unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public PipelineOptions pipelineOptions() {\n      throw new UnsupportedOperationException(\n          String.format(\"PipelineOptions unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public DoFn<InputT, OutputT>.StartBundleContext startBundleContext(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"StartBundleContext unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public DoFn<InputT, OutputT>.FinishBundleContext finishBundleContext(\n        DoFn<InputT, OutputT> doFn) {","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java#L402-L438","documentation":"window() throws UnsupportedOperationException because the invoker implementation has no BoundedWindow provider bound. It is normally available in windowed contexts (ProcessElement/OnWindowExpiration with window parameter). The error context in the message identifies the invoker lacking support.","triggerScenarios":"Calling invoker.window(doFn) (or a context resolving the window) on a DelegatingDoFnInvoker / generated invoker without a windowFactory; DoFn code calling c.window() when the runner didn't supply window info.","commonSituations":"Streaming/windowed DoFn code executed in a non-windowed test harness; custom invoker wiring that omits window suppliers; runners that do not expose BoundedWindow in the context.","solutions":["Request the window via the method signature (BoundedWindow parameter) so the runner supplies it","Bind a window factory when constructing the invoker","Use a runner/DoFnTester version that populates window context","Guard c.window() behind instanceof checks when invoking in custom code"],"exampleFix":"// before\nBoundedWindow w = context.window(); // may throw\n// after\n@ProcessElement\npublic void process(ProcessContext c, BoundedWindow window) { /* use window */ }","handlingStrategy":"type-guard","validationCode":"boolean windowed = context instanceof DoFn.WindowedContext;","typeGuard":"if (!(context instanceof DoFn.WindowedContext)) return null; BoundedWindow w = context.window();","tryCatchPattern":"try { BoundedWindow w = invoker.window(doFn); } catch (UnsupportedOperationException e) { w = null; }","preventionTips":["Prefer BoundedWindow method parameters injected by the runner","Check runner windowing support before calling c.window()","Bind windowFactory when constructing invokers"],"tags":["apache-beam","java","unsupported-operation","windowing"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}