Java Code:
List<ParsedUsuarioDto> parsedUsuarioDtos = new ArrayList<>(linhas.size());
for (String[] linha : linhas) {
parsedUsuarioDtos.add(ParsedUsuarioDto.builder()
.posicao(linhas.indexOf(linha) + 1)
.cpf(linha[0])
.rg(linha[1])
.nome(linha[2])
.mae(linha[3])
.celular(linha[4])
.email(linha[5])
.dataNascimento(linha[6])
.build());
}
Sonar gives me this message:
This method accesses an array or list using a constant integer index. Often, this is a typo where a loop variable is intended to be used. If however, specific list indices mean different specific things, then perhaps replacing the list with a first-class object with meaningful accessors would make the code less brittle.
How can i fix this bug?