{"record":{"id":"e4d8f339e7e6fe39","repo":"apache/beam","slug":"timing-number-0b-timingnumber-tostring-2-has-more-than-two","errorCode":null,"errorMessage":"Timing number 0b\" + timingNumber.toString(2) + \" has more than two bits of info","messagePattern":"Timing number 0b\" \\+ timingNumber\\.toString\\(2\\) \\+ \" has more than two bits of info","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/coders/required_coders.ts","lineNumber":525,"sourceCode":"export class PaneInfoCoder implements Coder<PaneInfo> {\n  static INSTANCE = new PaneInfoCoder();\n  static ONE_AND_ONLY_FIRING = PaneInfoCoder.INSTANCE.decode(\n    new Reader(new Uint8Array([0x09])),\n    null!,\n  );\n\n  private static decodeTiming(timingNumber): Timing {\n    switch (timingNumber) {\n      case 0b00:\n        return Timing.EARLY;\n      case 0b01:\n        return Timing.ON_TIME;\n      case 0b10:\n        return Timing.LATE;\n      case 0b11:\n        return Timing.UNKNOWN;\n      default:\n        throw new Error(\n          \"Timing number 0b\" +\n            timingNumber.toString(2) +\n            \" has more than two bits of info\",\n        );\n    }\n  }\n\n  private static encodeTiming(timing: Timing): number {\n    switch (timing) {\n      case Timing.EARLY:\n        return 0b00;\n      case Timing.ON_TIME:\n        return 0b01;\n      case Timing.LATE:\n        return 0b10;\n      case Timing.UNKNOWN:\n        return 0b11;\n      default:","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/coders/required_coders.ts#L507-L543","documentation":"JavaClassNameLookup.__init__ raises ValueError when both expansion_service and classpath are given. These are mutually exclusive ways to control how the expansion service is launched: either a fully specified service address/spec, or just a classpath for the default service. Providing both is treated as a conflicting configuration.","triggerScenarios":"JavaClassNameLookup(class_name, expansion_service='localhost:1234', classpath=['/path/x.jar']) — both parameters non-None/non-empty in the same constructor call.","commonSituations":"Copy-pasting example code that sets classpath into code that already passes expansion_service; layering configuration from two sources without clearing one.","solutions":["Remove the classpath argument if you want to use a specific expansion_service.","Remove the expansion_service argument and pass classpath to let Beam start a default service with extra jars."],"exampleFix":"// before\nJavaClassNameLookup('com.example.T', expansion_service='localhost:1234', classpath=['a.jar'])\n// after\nJavaClassNameLookup('com.example.T', classpath=['a.jar'])","handlingStrategy":"validation","validationCode":"assert not (expansion_service and classpath), 'pass either expansion_service or classpath, not both'","typeGuard":"def service_config_ok(expansion_service, classpath) -> bool:\n    return not (expansion_service and classpath)","tryCatchPattern":"try:\n    lookup = JavaClassNameLookup(cls, expansion_service=svc, classpath=cp)\nexcept ValueError as e:\n    logger.error('Conflicting service config: %s', e)","preventionTips":["Centralize expansion service configuration in one place","When switching from classpath to a fixed service, delete the other argument","Document which of the two options each pipeline uses"],"tags":["python","apache-beam","java","expansion-service","mutually-exclusive"],"backgroundTag":"mutually-exclusive-options","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"}