{"record":{"id":"c9c612370537b646","repo":"stanfordnlp/CoreNLP","slug":"unknown-default-state-setting","errorCode":null,"errorMessage":"Unknown default state setting: ","messagePattern":"Unknown default state setting: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/util/logging/VisibilityHandler.java","lineNumber":63,"sourceCode":"  public void hideAll() {\n    this.defaultState = State.HIDE_ALL;\n    this.deltaPool.clear();\n  }\n\n  /**\n   * Show all the channels currently being printed, in addition\n   * to a new one\n   * @param filter The channel to also show\n   * @return true if this channel was already being shown.\n   */\n  public boolean alsoShow(Object filter) {\n    switch(this.defaultState){\n    case HIDE_ALL:\n      return this.deltaPool.add(filter);\n    case SHOW_ALL:\n      return this.deltaPool.remove(filter);\n    default:\n      throw new IllegalStateException(\"Unknown default state setting: \" + this.defaultState);\n    }\n  }\n\n  /**\n   * Show all the channels currently being printed, with the exception\n   * of this new one\n   * @param filter The channel to also hide\n   * @return true if this channel was already being hidden.\n   */\n  public boolean alsoHide(Object filter) {\n    switch(this.defaultState){\n    case HIDE_ALL:\n      return this.deltaPool.remove(filter);\n    case SHOW_ALL:\n      return this.deltaPool.add(filter);\n    default:\n      throw new IllegalStateException(\"Unknown default state setting: \" + this.defaultState);\n    }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/util/logging/VisibilityHandler.java#L45-L81","documentation":"VisibilityHandler.alsoShow() adds or removes a channel filter from the deltaPool depending on defaultState. Only HIDE_ALL and SHOW_ALL are valid; any other defaultState value (should be impossible with the enum) throws this IllegalStateException.","triggerScenarios":"Calling alsoShow(VisibilityHandler) when the handler's defaultState is neither HIDE_ALL nor SHOW_ALL — only via broken construction, custom subclass, or corrupted/deserialized state.","commonSituations":"Rare; seen with hand-built VisibilityHandler instances, custom enum values via reflection, or version-mismatched jars where a third state exists in one class but not the switch.","solutions":["Construct VisibilityHandler through its normal constructors/factories so defaultState is HIDE_ALL or SHOW_ALL.","Use RedwoodConfiguration's hide/alsoShow configuration entries rather than manipulating the handler directly.","Print/inspect this.defaultState to find what set it; align all logging jars to the same version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  visibility.alsoShow(channel);\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"Unknown default state setting\")) {\n    log.error(\"VisibilityHandler defaultState corrupted: \" + e.getMessage());\n    // rebuild handler with a valid state\n  } else throw e;\n}","preventionTips":["Construct VisibilityHandler only via its standard constructors/RedwoodConfiguration.","Never set defaultState through reflection or from custom enum values.","Match Redwood jar versions across the classpath."],"tags":["logging","visibility","internal-state","enum"],"backgroundTag":"internal-invariant-violation","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}