AsmInstantiatorDefinitionFactory seems to have an issue with inner (non-static) classes when generics are involved: in #visitMethod, parsing desc leads to an additional type as compared to parsing signature, finally leading to an IndexOutOfBoundsException.
Reproducing Test:
public class SfmListTests {
private static Connection conn;
@BeforeClass
public static void init() throws SQLException {
conn = DriverManager.getConnection("jdbc:postgresql://localhost:4001/testing", "postgres", "testing");
}
@Test
public void failing() throws SQLException {
final String query = String.join("\n",
"with t (",
"id, foo_id",
" ) as ( values",
"('a', 'b')",
")",
"select * from t"
);
PreparedStatement stmt = conn.prepareStatement(query);
ResultSet rs = stmt.executeQuery();
final JdbcMapperFactory mapperFactory = JdbcMapperFactory.newInstance()
.useAsm(false)
.ignorePropertyNotFound()
.addKeys("id")
.addKeys("foos_id")
;
final Iterator<Root> iterator = mapperFactory.newMapper(Root.class).iterator(rs);
}
public class Root {
private String id;
private List<Foo> foos;
public Root() {}
public Root(final String id, final List<Foo> foos) {
this.id = id;
this.foos = foos;
}
}
class Foo {
private String id;
public Foo() {}
public Foo(final String id) {
this.id = id;
}
}
}
SFM 7.0.0
AsmInstantiatorDefinitionFactory
seems to have an issue with inner (non-static) classes when generics are involved: in#visitMethod
, parsingdesc
leads to an additional type as compared to parsingsignature
, finally leading to an IndexOutOfBoundsException.Reproducing Test: