{"record":{"id":"887edbab1c6340b0","repo":"stanfordnlp/CoreNLP","slug":"unsupported-prefix-pathtype-xmlpathtype","errorCode":null,"errorMessage":"Unsupported ${prefix}pathtype = ${xmlPathType}","messagePattern":"Unsupported (.+?)pathtype = (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/time/JollyDayHolidays.java","lineNumber":54,"sourceCode":"\n  @Override\n  public void init(String prefix, Properties props) {\n    String xmlPath = props.getProperty(prefix + \"xml\", \"edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml\");\n    String xmlPathType = props.getProperty(prefix + \"pathtype\", \"classpath\");\n    varPrefix = props.getProperty(prefix + \"prefix\", varPrefix);\n    logger.info(\"Initializing JollyDayHoliday for SUTime from \" + xmlPathType + ' ' + xmlPath + \" as \" + prefix);\n    Properties managerProps = new Properties();\n    managerProps.setProperty(\"manager.impl\", \"edu.stanford.nlp.time.JollyDayHolidays$MyXMLManager\");\n    try {\n      URL holidayXmlUrl;\n      if (xmlPathType.equalsIgnoreCase(\"classpath\")) {\n        holidayXmlUrl = getClass().getClassLoader().getResource(xmlPath);\n      } else if (xmlPathType.equalsIgnoreCase(\"file\")) {\n        holidayXmlUrl = new URL(\"file:///\" + xmlPath);\n      } else if (xmlPathType.equalsIgnoreCase(\"url\")) {\n        holidayXmlUrl = new URL(xmlPath);\n      } else {\n        throw new IllegalArgumentException(\"Unsupported \" + prefix + \"pathtype = \" + xmlPathType);\n      }\n      UrlManagerParameter ump = new UrlManagerParameter(holidayXmlUrl, managerProps);\n      holidayManager = HolidayManager.getInstance(ump);\n    } catch (java.net.MalformedURLException e) {\n      throw new RuntimeException(e);\n    }\n    if (!(holidayManager instanceof MyXMLManager)) {\n      throw new AssertionError(\"Did not get back JollyDayHolidays$MyXMLManager\");\n    }\n    Configuration config = ((MyXMLManager) holidayManager).getConfiguration();\n    holidays = getAllHolidaysMap(config);\n  }\n\n  @Override\n  public void bind(Env env) {\n    if (holidays != null) {\n      for (Map.Entry<String, JollyHoliday> holidayEntry : holidays.entrySet()) {\n        JollyHoliday jh = holidayEntry.getValue();","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/time/JollyDayHolidays.java#L36-L72","documentation":"JollyDayHolidays.init() resolves the holiday XML data according to the <prefix>pathtype option, which must be one of classpath, file, or url. Any other value is rejected with an IllegalArgumentException naming the configured pathtype.","triggerScenarios":"Setting the property '<prefix>pathtype' (e.g. 'holidays.pathtype') to a value other than 'classpath', 'file', or 'url' (case-insensitive) before calling init().","commonSituations":"Typo like 'classpath:' or 'resourse' in the properties file; copying config from another library that uses different pathtype vocabulary; forgetting to set the property at all so it defaults to an unexpected string.","solutions":["Set the pathtype property to exactly one of: classpath, file, or url (case-insensitive).","Check for typos or trailing characters (e.g. 'classpath:', whitespace) in the properties value.","Verify which prefix is used for the options object and that the property key matches '<prefix>pathtype'."],"exampleFix":"// before\nprops.setProperty(\"holidays.pathtype\", \"classpath: holidays.xml\");\n// after\nprops.setProperty(\"holidays.pathtype\", \"classpath\");\nprops.setProperty(\"holidays.path\", \"holidays.xml\");","handlingStrategy":"validation","validationCode":"String pathtype = props.getProperty(prefix + \"pathtype\", \"\").toLowerCase();\nif (!pathtype.equals(\"classpath\") && !pathtype.equals(\"file\") && !pathtype.equals(\"url\")) {\n  throw new IllegalArgumentException(prefix + \"pathtype must be classpath, file, or url; got: \" + pathtype);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep pathtype values in a shared constant/enum","Validate properties at startup before holiday initialization"],"tags":["configuration","holidays","illegal-argument"],"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-17T15:17:12.973Z"}