java code:
p.setCode((String) fileds[1]);
p.setTitle((String) fileds[2]);
p.setLogo((String) fileds[3]);
p.setMaxBorrowAmt((Integer) fileds[4]);
p.setMinBorrowAmt((Integer) fileds[5]);
fileds[] is Object array,it's created by Spring-Data-JPA to select something from 3 different tables;
@Query(
value="select a.id,a.code,b.title,b.logo,c.max from tableA a left join TableB b left join TableC c where ... ",
nativeQuery = true
)
List<Object[]> findSomething();
findbugs warning:
Method accesses list or array with constant index
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 should I fix this bug?