GMaur / java-duplicates-detector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java-duplicates-detector

This is a tool to help you find duplicates in constants in java files.

Usage

  1. Download the library
  2. Copy-paste this snippet:
RepeatedFinder sut = new RepeatedFinder(YourClass.class);
MultiMap<Object, String> duplicates = sut.findDuplicates();

for(Object current : duplicates.all()){
	System.out.println("found value = '" + current+"', with variables = " + duplicates.get(current));
}

Tests

See RepeatedFinderShould for some tests

Behavior

This class only finds repeated values in static variables.

Example:

public static Integer _3 = 3;
public static Integer THREE = 3; // repeated with _3

public Integer _2 = 2;
public Integer TWO = 2; // no repetition

About


Languages

Language:Java 100.0%