{"record":{"id":"76381ebfe9e83caf","repo":"pentaho/pentaho-kettle","slug":"row-endoffilereadingrow","errorCode":null,"errorMessage":"Row.EndOfFileReadingRow","messagePattern":"Row\\.EndOfFileReadingRow","errorType":"exception","errorClass":"KettleEOFException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/compatibility/Row.java","lineNumber":527,"sourceCode":"   * Read a number of Values without meta-data into a row.\n   *\n   * @param dis\n   *          The DataInputStream to read from\n   * @param size\n   *          the number or values to read\n   * @param meta\n   *          The description (name, type, length, precision) of the values to be read\n   * @throws KettleFileException\n   *           if the row couldn't be created by reading from the data input stream.\n   */\n  public Row( DataInputStream dis, int size, Row meta ) throws KettleFileException {\n    try {\n      // get all values in the row\n      for ( int i = 0; i < size; i++ ) {\n        addValue( new Value( meta.getValue( i ), dis ) );\n      }\n    } catch ( KettleEOFException e ) {\n      throw new KettleEOFException( BaseMessages.getString( PKG, \"Row.EndOfFileReadingRow\" ), e );\n    } catch ( Exception e ) {\n      throw new KettleFileException( BaseMessages.getString( PKG, \"Row.RowError\" ), e );\n    }\n  }\n\n  /**\n   * Write a row of Values to a DataOutputStream, without saving the meta-data.\n   *\n   * @param dos\n   *          The DataOutputStream to write to\n   * @return true if the row was written successfuly, false if something went wrong.\n   */\n  public boolean writeData( DataOutputStream dos ) throws KettleFileException {\n    // get all values in the row\n    for ( int i = 0; i < size(); i++ ) {\n      Value v = getValue( i );\n      v.writeData( dos );\n    }","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/compatibility/Row.java#L509-L545","documentation":"trim requires exactly 1 argument. This is a pure argument-count guard at ScriptValuesAddedFunctions.java:1650: when ArgList.length != 1 the function throws this Rhino runtime error. Unlike the 'not valid' variant, no processing was attempted - the call signature itself is wrong.","triggerScenarios":"Calling trim() with zero arguments, or trim(a, b) with multiple arguments, from JavaScript in the Script Values step.","commonSituations":"Assuming Java-style trim with character-set arguments like trim(str, 'x'); accidentally leaving a second argument from a chained expression; calling with an empty argument list after a variable rename.","solutions":["Call trim with exactly one argument: trim(str).","For trimming specific characters, implement it in JavaScript (replace/regex) rather than passing extra arguments.","Check the call site for stray commas that introduce extra arguments."],"exampleFix":"// before\nvar t = trim(str, \" \");\n// after\nvar t = trim(str);","handlingStrategy":"validation","validationCode":"if (arguments.length !== 1) throw new Error(\"trim takes exactly one argument\");","typeGuard":"null","tryCatchPattern":"var t;\ntry {\n  t = trim(str);\n} catch (e) {\n  t = (str == null ? \"\" : String(str)).replace(/^\\s+|\\s+$/g, \"\");\n}","preventionTips":["Never pass a character-set second argument - it is not supported","Check for stray commas creating extra arguments","One argument, one string"],"tags":["javascript","argument-count","string-processing","scripting"],"backgroundTag":"missing-required-argument","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"}