pentaho/pentaho-kettle · error · IllegalArgumentException
Clone not supported for
Error message
Clone not supported for
What it means
BaseFileField.clone() calls super.clone() (Object.clone), which throws CloneNotSupportedException unless the runtime class implements Cloneable. If a subclass of BaseFileField is not Cloneable, the catch block rethrows it as an IllegalArgumentException naming the class. This is an internal defensive wrapper that should never fire for correctly declared classes.
Solutions
- Make the concrete field class implement java.lang.Cloneable (it is a marker interface, no methods needed).
- Verify which class name appears in the message and check its 'implements' list.
- As a workaround, construct a new instance and copy fields manually instead of relying on clone().
Example fix
// before
public class MyField extends BaseFileField { }
// after
public class MyField extends BaseFileField implements Cloneable { } Defensive patterns
Strategy: try-catch
Validate before calling
if (!BaseFileField.class.isAssignableFrom(field.getClass()) || !Cloneable.class.isAssignableFrom(field.getClass())) {
throw new IllegalStateException(field.getClass().getName() + " must implement Cloneable");
} Type guard
boolean isCloneable(Object o) { return o instanceof Cloneable; } Try / catch
try {
Object copy = field.clone();
} catch (IllegalArgumentException e) {
// fall back to manual copy
throw new IllegalStateException("Class must implement Cloneable: " + e.getMessage(), e);
} Prevention
- Always declare 'implements Cloneable' on any subclass of BaseFileField.
- Add a unit test that clones every metadata class instance.
- Prefer copy constructors over clone() in new code.
When it happens
Trigger: Calling clone() on a BaseFileField instance whose concrete class does not implement the Cloneable marker interface.
Common situations: Someone added a new field-meta subclass extending BaseFileField but forgot to declare 'implements Cloneable'; refactoring removed the interface; reflection/serialization frameworks cloning step metadata at transformation copy time.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Clone not supported for
- Clone not supported for
- Error creating plugin class
- RuntimeException wrapping clone failure (no message; cause…
- Unable to get instance of plugin type
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/6d8bf16cef54e2d5.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/file/BaseFileField.java:142
}
@Override
public int compareTo( TextFileInputFieldInterface field ) {
return position - field.getPosition();
}
public boolean equal( Object obj ) {
BaseFileField field = (BaseFileField) obj;
return ( position == field.getPosition() );
}
@Override
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException ex ) {
throw new IllegalArgumentException( "Clone not supported for " + this.getClass().getName() );
}
}
@Override
public int getPosition() {
return position;
}
public void setPosition( int position ) {
this.position = position;
}
@Override
public int getLength() {
return length;
}
@OverrideView on GitHub (pinned to f3058517a1)