{"record":{"id":"32f1c68c04d77698","repo":"stanfordnlp/CoreNLP","slug":"unknown-collapse-mode-redwood","errorCode":null,"errorMessage":"Unknown collapse mode (Redwood): ","messagePattern":"Unknown collapse mode \\(Redwood\\): ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/util/logging/RedwoodConfiguration.java","lineNumber":591,"sourceCode":"    if(get(props,\"log.captureStreams\",\"false\",used).equalsIgnoreCase(\"true\")){\n      config = config.capture(System.out).capture(System.err);\n    }\n    if(get(props,\"log.captureStdout\",\"false\",used).equalsIgnoreCase(\"true\")){\n      config = config.capture(System.out);\n    }\n    if(get(props,\"log.captureStderr\",\"false\",used).equalsIgnoreCase(\"true\")){\n      config = config.capture(System.err);\n    }\n\n    //--Collapse\n    String collapse = get(props, \"log.collapse\", \"none\", used);\n    List<LogRecordHandler> chain = new LinkedList<>();\n    if (collapse.equalsIgnoreCase(\"exact\")) {\n      chain.add(new RepeatedRecordHandler(RepeatedRecordHandler.EXACT));\n    } else if (collapse.equalsIgnoreCase(\"approximate\")) {\n      chain.add(new RepeatedRecordHandler(RepeatedRecordHandler.APPROXIMATE));\n    } else if (!collapse.equalsIgnoreCase(\"none\")) {\n      throw new IllegalArgumentException(\"Unknown collapse mode (Redwood): \" + collapse);\n    }\n\n    //--Channels.Debug\n    boolean debug = Boolean.parseBoolean(get(props, \"log.channels.debug\", \"true\", used));\n    if (!debug) {\n      chain.add(Handlers.hideDebug);\n    }\n\n    //--Channels.Width\n    config.channelWidth( Integer.parseInt(get(props, \"log.channels.width\", \"0\", used)) );\n\n    //--Neat exit\n    if(get(props,\"log.neatExit\",\"false\",used).equalsIgnoreCase(\"true\")){\n      config = config.neatExit();\n    }\n\n    //--File\n    String outputFile = get(props, \"log.file\", null, used);","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/util/logging/RedwoodConfiguration.java#L573-L609","documentation":"RedwoodConfiguration.parse() interprets the 'log.collpse'/'collapse' property via RepeatedRecordHandler modes. Only exact, approximate, and none are accepted; anything else throws this IllegalArgumentException.","triggerScenarios":"Applying properties where the collapse setting (log.collapse, e.g. \"true\", \"repeated\", \"compact\") is not one of exact/approximate/none (comparison is case-insensitive).","commonSituations":"Copy-pasting collapse settings from other frameworks; guessing boolean-like values (true/false) thinking collapse is a flag; typos such as 'excat' or 'aproximate'.","solutions":["Set collapse to one of: exact, approximate, or none.","Remove the collapse property entirely to use the default behavior.","Check case-insensitive spelling of the value.","If unsure what modes do, use 'exact' (identical repeated records collapsed) or 'none' (no collapsing)."],"exampleFix":"// before\nprops.setProperty(\"log.collapse\", \"true\");\n// after\nprops.setProperty(\"log.collapse\", \"exact\"); // or approximate / none","handlingStrategy":"validation","validationCode":"String collapse = props.getProperty(\"log.collapse\", \"none\");\nif (!(\"exact\".equalsIgnoreCase(collapse) || \"approximate\".equalsIgnoreCase(collapse) || \"none\".equalsIgnoreCase(collapse))) {\n  throw new IllegalArgumentException(\"log.collapse must be exact, approximate, or none: \" + collapse);\n}","typeGuard":null,"tryCatchPattern":"try {\n  RedwoodConfiguration.applyProperties(props);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown collapse mode\")) {\n    System.err.println(\"Bad log.collapse value; using 'none'\");\n    props.setProperty(\"log.collapse\", \"none\");\n    RedwoodConfiguration.applyProperties(props);\n  } else throw e;\n}","preventionTips":["Only use the literals exact/approximate/none for collapse settings.","Do not treat collapse as a boolean flag; use 'none' to disable.","Validate config values centrally before handing Properties to Redwood."],"tags":["logging","configuration","illegal-argument","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}