# Data masking

### Excluding variables' values from RevDeBug recordings

Built-in data masking can be applied to any variable and will exclude its value from RevDeBug recording.

To use the capability you need to provide the identifiers of variable names to ignore in a `rdbIgnore` file. Add the `rdbIgnore` into the project, eg.:

![example project structure](/files/-MdH1buHDj_89xuJudnK)

And fill it in with variable names which will get excluded from RevDeBug recordings. Each variable name should be named on a separate line in the file. Regular expressions are accepted to match more than one method at the same time:

![content example](/files/-MdH1pHWUIfTVp2r6ZOC)

After the next full rebuild of the project, the variables matching the names will be excluded from being recorded.

### Excluding specified methods from RevDeBug recordings

You can exclude selected methods from RevDeBug recording by annotating them with

"`@RevDeBug.RevDeBugIgnore"`, eg:

```java
public class Main {

    @RevDeBug.RevDeBugIgnore
    public static void main(String[] args) {

        System.out.println("Hello world");
    }
```

The same can be done with compiler arguments and whole packages or classes can be matched as well. Just add "`-AREVDEBUG_EXCLUDE_METHODS`" or "`-AREVDEBUG_EXCLUDE`" to RevDeBug options in your project build file. Regular expressions are accepted to match more than one method at the same time, eg.:

{% tabs %}
{% tab title="Maven" %}

```xml
pom.xml

       <configuration>
           <compilerArgs>
               <!-- ... -->
               <arg>-AREVDEBUG_EXCLUDE_METHODS=.*\.toString\(\)$,.*\.clone\(\)$,.*\.hashCode\(\)$,.*\.get.*$,.*\.set.*$,.*\.is.*$</arg>
               <arg>-AREVDEBUG_EXCLUDE_CLASSES=.*\.[Uu]til(s)?.*$,.*\.[Cc]rypt.*$,.*[Uu]til(s)?$,.*[Cc]rypt(o)?$</arg>
               <!-- ... -->
           </compilerArgs>
       ...

```

{% endtab %}

{% tab title="Gradle" %}

```groovy

   build.gradle
   
   compileJava {
       options.compilerArgs = [
       //...
               "-AREVDEBUG_EXCLUDE_METHODS=.*\.toString\(\)$,.*\.clone\(\)$,.*\.hashCode\(\)$,.*\.get.*$,.*\.set.*$,.*\.is.*$",
               "-AREVDEBUG_EXCLUDE_CLASSES=.*\.[Uu]til(s)?.*$,.*\.[Cc]rypt.*$,.*[Uu]til(s)?$,.*[Cc]rypt(o)?$",
       //...
   ]}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://revdebug.gitbook.io/revdebug/supported-langauges/java/record-exclusion-inclusion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
