You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[jcw-gen] Constructors should respect ExportAttribute (#170)
Context: https://github.com/mono/Embeddinator-4000
Embeddinator-4000 will bring a lot more developers to consume C#
objects from their Java code. One pain point here is that all
constructors are generating `throws java.lang.Throwable` regardless of
the `[Export]` declaration. Looking into it further, there was also the
issue if you declared an empty Type[], jcw-gen was not handling that
case.
Changes:
- Added `ThrowsDeclaration` property for reuse, which also handles the
case of empty `Type[]`
- Constructors now use `ThrowsDeclaration` along with methods
- New test cases: a class with constructors with plain `[Export]` and a
class with `[Export]` declaring `Throws`
- Expanded methods test case: method with `Throws` and method with
`Throws` and an empty `Type[]`
Copy file name to clipboardExpand all lines: src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs
Copy file name to clipboardExpand all lines: src/Java.Interop.Tools.JavaCallableWrappers/Test/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGeneratorTests.cs
Copy file name to clipboardExpand all lines: src/Java.Interop.Tools.JavaCallableWrappers/Test/Java.Interop.Tools.JavaCallableWrappers/SupportDeclarations.cs
0 commit comments