Data masking
Data masking capabilities of RevDeBug for Java projects and how to use them.

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
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, eg.:
content example
After 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
"@RevDeBugConfig.Annotation.Exclude", eg:
1
public class Main {
2
3
@RevDeBugConfig.Annotation.Exclude
4
public static void main(String[] args) {
5
6
System.out.println("Hello world");
7
}
Copied!
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, eg.:
Maven
Gradle
1
pom.xml
2
3
<configuration>
4
<compilerArgs>
5
...
6
<arg>-AREVDEBUG_EXCLUDE_METHODS=[method1, m2, ...]</arg>
7
<arg>-AREVDEBUG_EXCLUDE=[package.classname, package]</arg>
8
...
9
</compilerArgs>
10
...
11
Copied!
1
2
build.gradle
3
4
compileJava {
5
options.compilerArgs = [
6
...
7
"-AREVDEBUG_EXCLUDE_METHODS=[method1, m2, ...]",
8
"-AREVDEBUG_EXCLUDE=[package.classname, package]",
9
...
10
]}
Copied!

Include only specified parts of the code in the recordings

You can also switch RevDeBug to only record specified methods in your code. The methods will need to be annotated with "@RevDeBugConfig.Annotation.Include", eg:
1
public class Main {
2
3
@RevDeBugConfig.Annotation.Include
4
public static void main(String[] args) {
5
6
System.out.println("Hello world");
7
Copied!
And you need to enable "-AREVDEBUG_ANNOTATED_ONLY" option in your project build file, eg.:
Maven
Gradle
1
pom.xml
2
3
<configuration>
4
<compilerArgs>
5
...
6
<arg>-AREVDEBUG_ANNOTATED_ONLY=true</arg>
7
...
8
</compilerArgs>
9
...
Copied!
1
build.gradle
2
3
compileJava {
4
options.compilerArgs = [
5
...
6
"-AREVDEBUG_ANNOTATED_ONLY=true",
7
...
8
]}
Copied!
After next full rebuild of the project only annotated methods like in the example above will get recorded by RevDeBug.