{"record":{"id":"8add30c8e1f4ff30","repo":"pentaho/pentaho-kettle","slug":"this-functionality-for-timestamp-object-has-not-been","errorCode":null,"errorMessage":"This functionality for Timestamp object has not been implemented yet","messagePattern":"This functionality for Timestamp object has not been implemented yet","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/timestamp/SimpleTimestampFormat.java","lineNumber":296,"sourceCode":"\n  private int replaceHolder( StringBuffer dateBuffer, Boolean inPattern ) {\n    String placeHolder = inPattern ? ESCAPED_NANOSECOND_PLACEHOLDER : NANOSECOND_PLACEHOLDER;\n    int placeholderPosition = dateBuffer.indexOf( placeHolder );\n    if ( placeholderPosition == -1 ) {\n      return 0;\n    }\n    dateBuffer.delete( placeholderPosition, placeholderPosition + placeHolder.length() );\n    return placeholderPosition;\n  }\n\n  /**\n   * See <code>SimpleDateFormat</code> description. This is dummy method to deprecate using parent implementation for\n   * <code>Timestamp</code> until it is not fully implemented.\n   */\n  @Override\n  public AttributedCharacterIterator formatToCharacterIterator( Object obj ) {\n    if ( obj instanceof Timestamp ) {\n      throw new IllegalArgumentException(\n        \"This functionality for Timestamp object has not been implemented yet\" );\n    }\n    if ( compatibleToSuperPattern ) {\n      return super.formatToCharacterIterator( obj );\n    } else {\n      throw new IllegalArgumentException(\n        \"This functionality for specified format pattern has not been implemented yet\" );\n    }\n  }\n\n  /**\n   * Parses text from a string to produce a <code>Timestamp</code>.\n   * <p/>\n   * The method attempts to parse text starting at the index given by <code>pos</code>. If parsing succeeds, then the\n   * index of <code>pos</code> is updated to the index after the last character used (parsing does not necessarily use\n   * all characters up to the end of the string), and the parsed date is returned. The updated <code>pos</code> can be\n   * used to indicate the starting point for the next call to this method. If an error occurs, then the index of\n   * <code>pos</code> is not changed, the error index of <code>pos</code> is set to the index of the character where the","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/timestamp/SimpleTimestampFormat.java#L278-L314","documentation":"SimpleTimestampFormat.formatToCharacterIterator() deliberately rejects java.sql.Timestamp input with IllegalArgumentException because character-iterator formatting for Timestamp is not implemented; the class only intends full support for its documented format/parse paths. This is a guard against silently using the incomplete parent (SimpleDateFormat) implementation.","triggerScenarios":"Calling formatToCharacterIterator(obj) where obj instanceof java.sql.Timestamp; it throws before checking the pattern.","commonSituations":"Code that formats dates generically via Format.formatToCharacterIterator encountering Timestamp values; UI code rendering Timestamp fields with attributed iterators.","solutions":["Use format(Object) / format(Timestamp, StringBuffer, FieldPosition) instead of formatToCharacterIterator","Convert the Timestamp to java.util.Date only if you truly want the super SimpleDateFormat behavior (not recommended with this class)","Catch IllegalArgumentException and fall back to standard SimpleDateFormat for rendering"],"exampleFix":"// before\nfmt.formatToCharacterIterator(ts);\n// after\nStringBuffer sb = new StringBuffer();\nfmt.format(ts, sb, new FieldPosition(0));","handlingStrategy":"fallback","validationCode":"if (obj instanceof java.sql.Timestamp) { /* use fmt.format(obj, sb, pos) instead */ }","typeGuard":"boolean supportsCharacterIterator(Object o) { return !(o instanceof java.sql.Timestamp); }","tryCatchPattern":"try {\n  return fmt.formatToCharacterIterator(obj);\n} catch (IllegalArgumentException e) {\n  return fallbackSimpleDateFormat.formatToCharacterIterator(obj);\n}","preventionTips":["Never call formatToCharacterIterator on SimpleTimestampFormat","Use format(Timestamp, StringBuffer, FieldPosition) for rendering","Check the class javadoc for supported methods"],"tags":["unsupported-operation","timestamp","formatting"],"backgroundTag":"unsupported-operation","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}