{"record":{"id":"e7b0c983a42fbbb4","repo":"stanfordnlp/CoreNLP","slug":"no-value-specified-for-this","errorCode":null,"errorMessage":"no value specified for ${this}","messagePattern":"no value specified for (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/time/Timex.java","lineNumber":392,"sourceCode":"   */\n  public Pair<Calendar, Calendar> getRange() {\n    return this.getRange(null);\n  }\n\n  /**\n   * Gets two Calendars, marking the beginning and ending of this Timex's range.\n   *\n   * @param documentTime\n   *          The time the document containing this Timex was written. (Not\n   *          necessary for resolving all Timex expressions. This may be\n   *          {@code null}, but then relative time expressions cannot be\n   *          resolved.)\n   * @return The begin point and end point Calendars.\n   */\n  public Pair<Calendar, Calendar> getRange(Timex documentTime) {\n\n    if (this.val == null) {\n      throw new UnsupportedOperationException(\"no value specified for \" + this);\n    }\n\n    // YYYYMMDD or YYYYMMDDT... where the time is concatenated directly with the\n    // date\n    else if (val.length() >= 8 && Pattern.matches(\"\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\", this.val.substring(0, 8))) {\n      int year = Integer.parseInt(this.val.substring(0, 4));\n      int month = Integer.parseInt(this.val.substring(4, 6));\n      int day = Integer.parseInt(this.val.substring(6, 8));\n      return new Pair<>(makeCalendar(year, month, day), makeCalendar(year, month, day));\n    }\n    // YYYY-MM-DD or YYYY-MM-DDT...\n    else if (val.length() >= 10 && Pattern.matches(\"\\\\d\\\\d\\\\d\\\\d-\\\\d\\\\d-\\\\d\\\\d\", this.val.substring(0, 10))) {\n      int year = Integer.parseInt(this.val.substring(0, 4));\n      int month = Integer.parseInt(this.val.substring(5, 7));\n      int day = Integer.parseInt(this.val.substring(8, 10));\n      return new Pair<>(makeCalendar(year, month, day), makeCalendar(year, month, day));\n    }\n","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/time/Timex.java#L374-L410","documentation":"Timex.getRange(documentTime) throws UnsupportedOperationException immediately when the Timex 'val' is null. Without a value string there is no date or duration to expand into a begin/end Calendar pair.","triggerScenarios":"Calling getRange() on a Timex constructed without a value, e.g. new Timex(type) without val, or a TIMEX3 annotation whose VAL attribute was absent in the source TimeML document.","commonSituations":"Processing TimeML where some TIMEX3 elements only carry a type (DATE/DURATION) and begin/end offsets but no normalized VAL attribute, then asking for the range.","solutions":["Ensure the TIMEX3 source annotation has a VAL attribute before extracting ranges","Check timex.val() for null before calling getRange() and skip such Timexes","If you built the Timex yourself, pass the value string in the constructor","Re-run the temporal normalizer (SUTime) with proper document creation time so VAL gets filled"],"exampleFix":"// before\nPair<Calendar,Calendar> range = timex.getRange(documentTime);\n// after\nif (timex.val() == null) {\n  throw new SkipTimexException(\"Timex has no VAL\");\n}\nPair<Calendar,Calendar> range = timex.getRange(documentTime);","handlingStrategy":"validation","validationCode":"if (timex.val() == null) { skip(); } else { timex.getRange(documentTime); }","typeGuard":"boolean hasVal(Timex t) { return t != null && t.val() != null; }","tryCatchPattern":"try { range = timex.getRange(documentTime); } catch (UnsupportedOperationException e) { range = null; }","preventionTips":["Verify TIMEX3 VAL attributes exist after SUTime normalization","Fail fast when building Timex objects without values","Log null-VAL Timexes during corpus preprocessing"],"tags":["java","timex","timeml"],"backgroundTag":"missing-required-argument","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"}