mapstruct / mapstruct-idea

An IntelliJ IDEA plugin for working with MapStruct
Other
141 stars 38 forks source link

fix IndexOutOfBoundsException for target methods without parameter #141

Closed hduelme closed 1 year ago

hduelme commented 1 year ago

I was able to reproduce #110. The error occurs when the target method has no parameters and the IDE tries to evaluate the expression. I found that the same problem results in a crash if you try to complete an sub-method of such an target. I provided testcases for both problems and the fixes.

Fixes #110

hduelme commented 1 year ago

Another thing to notice, currently there is no warning/error if the target is invalid. We should add such a check to inform the user.

filiphr commented 1 year ago

Another thing to notice, currently there is no warning/error if the target is invalid. We should add such a check to inform the user.

I agree with you @hduelme. I think that #11 is meant for that.