{"record":{"id":"8b791fc5cf08d383","repo":"stanfordnlp/CoreNLP","slug":"invalid-sieve-ordering-constraint-s","errorCode":null,"errorMessage":"Invalid sieve ordering constraint: ${s}","messagePattern":"Invalid sieve ordering constraint: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java","lineNumber":610,"sourceCode":"    for (int i = 0; i < sieveNames.length; i++) {\n      if (sieveNames[i].equals(sieveName)) {\n        return i;\n      }\n    }\n    throw new IllegalArgumentException(\"Invalid sieve name: \" + sieveName);\n  }\n\n  private static Pair<Integer,Integer> fromSieveOrderConstraintString(String s, String[] sieveNames)\n  {\n    String[] parts = s.split(\"<\");\n    if (parts.length == 2) {\n      String first = parts[0].trim();\n      String second = parts[1].trim();\n      int a = fromSieveNameToIndex(first, sieveNames);\n      int b = fromSieveNameToIndex(second, sieveNames);\n      return new Pair<>(a, b);\n    } else {\n      throw new IllegalArgumentException(\"Invalid sieve ordering constraint: \" + s);\n    }\n  }\n\n  private static String toSieveOrderConstraintString(Pair<Integer,Integer> orderedSieveIndices, String[] sieveNames)\n  {\n    String first = (orderedSieveIndices.first() < 0)? \"*\":sieveNames[orderedSieveIndices.first()];\n    String second = (orderedSieveIndices.second() < 0)? \"*\":sieveNames[orderedSieveIndices.second()];\n    return first + \" < \" + second;\n  }\n\n  /**\n   * Given a set of sieves, select an optimal ordering for the sieves\n   * by iterating over sieves, and selecting the one that gives the best score and\n   *   adding sieves one at a time until no more sieves left\n   */\n  public void optimizeSieveOrdering(MentionExtractor mentionExtractor, Properties props, String timestamp) throws Exception\n  {\n    logger.info(\"=============SIEVE OPTIMIZATION START ====================\");","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java#L592-L628","documentation":"fromSieveOrderConstraintString parses each ordering constraint by splitting on '<' and requires exactly two parts. If the constraint string does not contain exactly one '<' separator (parts.length != 2), it throws an IllegalArgumentException 'Invalid sieve ordering constraint: <s>'.","triggerScenarios":"Supplying a malformed constraint like 'A' (no '<'), 'A<B<C' (multiple '<'), or whitespace-only/garbled entries in the ordering constraints property; the split on '<' then yields 1 or 3+ parts.","commonSituations":"Typos when hand-editing the ordering property; list separators (comma vs. some other delimiter) causing entries to glue together; copy-paste introducing extra '<' or newline characters into a constraint.","solutions":["Ensure every constraint has the form 'SieveA<SieveB' with exactly one '<'","Check that constraint entries are comma-separated and none accidentally contains extra '<' characters","Trim whitespace/newlines from the property value; use '*' for the ANY side","Pre-validate each entry by replicating the split-on-'<' and length==2 check"],"exampleFix":"// before\ndcoref.optimize.sievesOrder = ExactStringMatch\n// after\ndcoref.optimize.sievesOrder = *<ExactStringMatch","handlingStrategy":"validation","validationCode":"for (String o : props.getProperty(\"dcoref.optimize.sievesOrder\",\"\").split(\",\")) {\n  if (o.trim().split(\"<\").length != 2)\n    throw new IllegalArgumentException(\"Constraint must be 'A<B': \" + o);\n}","typeGuard":null,"tryCatchPattern":"try {\n  new SieveCoreferenceSystem(props);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Invalid sieve ordering constraint\")) {\n    logger.warning(\"Malformed constraint skipped: \" + e.getMessage());\n    props.setProperty(\"dcoref.optimize.sievesOrder\", sanitizeConstraints(props.getProperty(\"dcoref.optimize.sievesOrder\")));\n  } else throw e;\n}","preventionTips":["Always write constraints as exactly 'SieveA<SieveB' with one '<'","Use commas as the entry separator and trim whitespace/newlines","Lint the ordering property for stray '<' before running long jobs"],"tags":["corenlp","coreference","configuration","format-error"],"backgroundTag":"invalid-argument-format","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"}