ozlerhakan / poiji

:candy: A library converting XLS and XLSX files to a list of Java objects based on Apache POI

Home Page:https://ozlerhakan.github.io/poiji/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potential IAE with 4.1.1 due to deprecation fix

DManstrator opened this issue · comments

commented

In commit ca30938, Constructor#isAccessible was replaced by Constructor#canAccess(null). From what I've seen within the source code, this could raise an IllegalArgumentException since null is treated as an invalid value.

I honestly don't know what else could be used but I wanted to point it out.

Thank you for contributing to Poiji! Feel free to create a PR If you want to contribute directly :)

Hi @DManstrator , I was aware of that case. I was thinking that this unlikely happens to have IAE while debugging the code.

commented

I looked at the source code again and searched for example usages. The examples also use null as the param and by looking closely, the method can also throw for non-null usages. And the JavaDocs explain the following:

if this reflected object is a static member or constructor and the given {@code obj} is non-{@code null}

So I guess it is correct in this case, sorry for the inconveniences.