---
title: "KeepOriginal"
description: "If a class annotated with TargetClass is also annotated with Substitute, all non-substituted methods in that class are by default treated as deleted."
kind: "annotation interface"
id: "com.oracle.svm.core.annotate.KeepOriginal"
module: "nativeimage"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/nativeimage/com/oracle/svm/core/annotate/KeepOriginal.html"
---

# @ KeepOriginal

[nativeimage](../../../../../index.md) › [com.oracle.svm.core.annotate](index.md) · Every page: [llms.txt](../../../../../llms.txt)

Annotation interface in [`com.oracle.svm.core.annotate`](index.md). Since 22.3.

```java
@Retention(RUNTIME)
@Target({METHOD, TYPE})
public @interface KeepOriginal
```

If a class annotated with [`TargetClass`](TargetClass.md) is also annotated with [`Substitute`](Substitute.md), all non-substituted methods in that class are by default treated as [`deleted`](Delete.md). This annotation changes the behavior: A method annotated with [`KeepOriginal`](KeepOriginal.md) keeps the original definition of the method.

If this annotation is used to the [`* substituted`](Substitute.md) type itself, then the original definition of all methods and fields in the target type are kept by default.

The element can also be annotated with [`TargetElement`](TargetElement.md) to specify additional properties. See [`TargetClass`](TargetClass.md) for an overview of the annotation system.
