I am using IntelliJ PMD plugin, and it gives me LOD violation, on the if(keys[i].equals(key))
. Keys is an object in the same class within the function.
public Object get(Object key) {
int n,i;
for(i=0,n=0;i<keys.length;i++) {
if(n >= nelems)
break ;
if ( keys[i] == null )
continue;
if(keys[i].equals(key))
return values[i] ;
n++ ;
}
return null;
}
You can find the whole code here : https://raw.githubusercontent.com/Sable/abc/master/benchmarks/Jigsaw/src/classes/org/w3c/util/ArrayDictionary.java