{"record":{"id":"5be4236bb4acfb9d","repo":"stanfordnlp/CoreNLP","slug":"cannot-create-set-of-holidays","errorCode":null,"errorMessage":"Cannot create set of holidays.","messagePattern":"Cannot create set of holidays\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/time/JollyDayHolidays.java","lineNumber":121,"sourceCode":"        map.add(jh.label, jh);\n      }\n    }\n    return map;\n  }\n\n  public CollectionValuedMap<String, JollyHoliday> getAllHolidaysCVMap(Configuration config) {\n    Set<de.jollyday.config.Holiday> s = getAllHolidays(config);\n    return getAllHolidaysCVMap(s);\n  }\n\n  public static void getAllHolidays(Holidays holidays, Set<de.jollyday.config.Holiday> allHolidays) {\n    for (Method m : holidays.getClass().getMethods()) {\n      if (isGetter(m) && m.getReturnType() == List.class) {\n        try {\n          List<de.jollyday.config.Holiday> l = (List<de.jollyday.config.Holiday>) m.invoke(holidays);\n          allHolidays.addAll(l);\n        } catch (Exception e) {\n          throw new RuntimeException(\"Cannot create set of holidays.\", e);\n        }\n      }\n    }\n  }\n\n  public static void getAllHolidays(Configuration config, Set<de.jollyday.config.Holiday> allHolidays) {\n    Holidays holidays = config.getHolidays();\n    getAllHolidays(holidays, allHolidays);\n    List<Configuration> subConfigs = config.getSubConfigurations();\n    for (Configuration c:subConfigs) {\n      getAllHolidays(c, allHolidays);\n    }\n  }\n\n  public static Set<de.jollyday.config.Holiday> getAllHolidays(Configuration config) {\n    Set<de.jollyday.config.Holiday> allHolidays = Generics.newHashSet();\n    getAllHolidays(config, allHolidays);\n    return allHolidays;","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/time/JollyDayHolidays.java#L103-L139","documentation":"getAllHolidays uses reflection to invoke every getter returning List<de.jollyday.config.Holiday> on a jollyday configuration object. If any reflective invocation fails (IllegalAccessException, InvocationTargetException from a getter, etc.), it wraps the failure in a RuntimeException with this message and the cause attached.","triggerScenarios":"Calling JollyDayHolidays.getAllHolidays(Configuration, Set) on a Configuration whose getter methods throw when invoked, or when a jollyday version change alters the config classes so getters fail or the cast to List<Holiday> fails.","commonSituations":"Upgrading/degrading the de.jollyday dependency so Configuration getter signatures change; security managers or module access blocking reflective invocation; a corrupted custom Configuration implementation.","solutions":["Read the wrapped cause (e.getCause()) to find the actual failing getter and address its root problem.","Align the jollyday library version with the one Stanford CoreNLP's JollyDayHolidays was compiled against.","Validate the holiday XML configuration loads correctly (the getters often fail because of lazily-parsed bad data)."],"exampleFix":"// before\n// jollyday 0.4.x used with newer CoreNLP\ndependencies { compile 'de.jollyday:jollyday:0.4.9' }\n// after\n// use the version matching the CoreNLP release\ndependencies { compile 'de.jollyday:jollyday:0.5.8' }","handlingStrategy":"try-catch","validationCode":"try {\n  Class.forName(\"de.jollyday.config.Configuration\");\n} catch (ClassNotFoundException e) {\n  throw new IllegalStateException(\"jollyday dependency missing from classpath\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  JollyDayHolidays.getAllHolidays(config, set);\n} catch (RuntimeException e) {\n  Throwable root = e;\n  while (root.getCause() != null) root = root.getCause();\n  logger.severe(\"Holiday getter failed: \" + root);\n  throw e;\n}","preventionTips":["Pin the jollyday version matching your CoreNLP release","Log full cause chains when debugging reflective failures","Validate holiday XML files load before production use"],"tags":["reflection","holidays","initialization","version-compatibility"],"backgroundTag":"module-init-failed","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"}