stanfordnlp/CoreNLP · error · IllegalStateException
Unknown default state setting:
Error message
Unknown default state setting:
What it means
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.
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.
Defensive patterns
Strategy: try-catch
Try / catch
try {
visibility.alsoShow(channel);
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("Unknown default state setting")) {
log.error("VisibilityHandler defaultState corrupted: " + e.getMessage());
// rebuild handler with a valid state
} else throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Should not reach this switch case
- Unknown collapse mode (Redwood):
- after W derivative, index() != x.length()
- Arabic does not support feature type: " + feat.toString()
- Bad tree state:
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/c9c612370537b646.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/util/logging/VisibilityHandler.java:63
public void hideAll() {
this.defaultState = State.HIDE_ALL;
this.deltaPool.clear();
}
/**
* Show all the channels currently being printed, in addition
* to a new one
* @param filter The channel to also show
* @return true if this channel was already being shown.
*/
public boolean alsoShow(Object filter) {
switch(this.defaultState){
case HIDE_ALL:
return this.deltaPool.add(filter);
case SHOW_ALL:
return this.deltaPool.remove(filter);
default:
throw new IllegalStateException("Unknown default state setting: " + this.defaultState);
}
}
/**
* Show all the channels currently being printed, with the exception
* of this new one
* @param filter The channel to also hide
* @return true if this channel was already being hidden.
*/
public boolean alsoHide(Object filter) {
switch(this.defaultState){
case HIDE_ALL:
return this.deltaPool.remove(filter);
case SHOW_ALL:
return this.deltaPool.add(filter);
default:
throw new IllegalStateException("Unknown default state setting: " + this.defaultState);
}View on GitHub (pinned to 1b7edd19c4)