com4j icon indicating copy to clipboard operation
com4j copied to clipboard

Methods with return type void fail when using default values

Open tonyroberts opened this issue 6 years ago • 0 comments

When generateDefaultMethodOverloads is set to true, methods with return type void have a @ReturnValue annotation added with index=-1.

Void methods don't need a ReturnValue annotation, even when using default values. This causes problems later as when invoking the method the runtime looks for a converter and doesn't find one.

See MethodBind.java @ line 556 and ComMethod.java @ line 96 (called indirectly from Wrapper.java @ line 179)

tonyroberts avatar May 30 '18 10:05 tonyroberts