This is a tool to help you find duplicates in constants in java files.
- Download the library
- 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));
}
See RepeatedFinderShould for some tests
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