From 9879e11b902d5b838e6713597e10c22533ac7370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=91=A8=F0=9F=8F=BC=E2=80=8D=F0=9F=92=BB=20Romain=20M?= =?UTF-8?q?arcadier-Muller?= Date: Thu, 24 Oct 2019 14:04:35 +0200 Subject: [PATCH] fix(java,dotnet): emit default implementations for optional properties For optional properties on interfaces, emit default implementations when possible (for .NET, this requires `netcoreapp3.0` or later) so that adding a new optional property on an interface does not break existing core that implements the interface. In it's current form, the getters always return `null`, while the setters throw an exception (this may change in the future). Fixes #543 --- .../lib/targets/dotnet/dotnetgenerator.ts | 17 +++++++++ .../lib/targets/dotnet/filegenerator.ts | 2 +- packages/jsii-pacmak/lib/targets/java.ts | 16 +++++++-- packages/jsii-pacmak/test/diff-test.sh | 5 --- ...s.CalculatorPackageId.BasePackageId.csproj | 2 +- ...ts.CalculatorPackageId.LibPackageId.csproj | 2 +- .../LibNamespace/IMyFirstStruct.cs | 7 ++++ .../LibNamespace/IStructWithOnlyOptionals.cs | 21 +++++++++++ .../tests/calculator/lib/MyFirstStruct.java | 4 ++- .../lib/StructWithOnlyOptionals.java | 12 +++++-- ...azon.JSII.Tests.CalculatorPackageId.csproj | 2 +- .../CalculatorNamespace/ICalculatorProps.cs | 14 ++++++++ .../IDeprecatedInterface.cs | 11 ++++++ .../CalculatorNamespace/IDerivedStruct.cs | 21 +++++++++++ .../IEraseUndefinedHashValuesOptions.cs | 14 ++++++++ .../IExperimentalInterface.cs | 11 ++++++ .../Tests/CalculatorNamespace/IGreetee.cs | 7 ++++ .../ILoadBalancedFargateServiceProps.cs | 35 +++++++++++++++++++ .../INullShouldBeTreatedAsUndefinedData.cs | 7 ++++ .../CalculatorNamespace/IOptionalStruct.cs | 7 ++++ .../CalculatorNamespace/ISecondLevelStruct.cs | 7 ++++ .../CalculatorNamespace/IStableInterface.cs | 11 ++++++ .../IStructWithJavaReservedWords.cs | 21 +++++++++++ .../CalculatorNamespace/ITopLevelStruct.cs | 7 ++++ .../CalculatorNamespace/IUnionProperties.cs | 7 ++++ .../tests/calculator/CalculatorProps.java | 8 +++-- .../jsii/tests/calculator/DerivedStruct.java | 12 +++++-- .../EraseUndefinedHashValuesOptions.java | 8 +++-- .../amazon/jsii/tests/calculator/Greetee.java | 4 ++- .../calculator/IDeprecatedInterface.java | 8 +++-- .../calculator/IExperimentalInterface.java | 8 +++-- .../tests/calculator/IStableInterface.java | 8 +++-- .../LoadBalancedFargateServiceProps.java | 20 ++++++++--- .../NullShouldBeTreatedAsUndefinedData.java | 4 ++- .../jsii/tests/calculator/OptionalStruct.java | 4 ++- .../tests/calculator/SecondLevelStruct.java | 4 ++- .../StructWithJavaReservedWords.java | 12 +++++-- .../jsii/tests/calculator/TopLevelStruct.java | 4 ++- .../tests/calculator/UnionProperties.java | 4 ++- 39 files changed, 336 insertions(+), 42 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts index 4721db20b3..250c2b8954 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts @@ -183,10 +183,27 @@ export class DotNetGenerator extends Generator { const isOptionalPrimitive = this.isOptionalPrimitive(prop) ? '?' : ''; this.code.openBlock(`${propType}${isOptionalPrimitive} ${propName}`); + if (prop.optional) { + // Conditional compilation - default interface implementation requires C#8.0 support, which imples netcoreapp3.0 or above! + this.code.line('#if NETCOREAPP3_0'); + this.code.openBlock('get'); + this.code.line('return null;'); + this.code.closeBlock(); + if (!prop.immutable) { + this.code.openBlock('set'); + this.code.line(`throw new System.NotSupportedException("'set' for '${propName}' is not implemented");`); + this.code.closeBlock(); + } + this.code.line('#else') + } this.code.line('get;'); if (!prop.immutable) { this.code.line('set;'); } + if (prop.optional) { + this.code.line('#endif'); + } + this.code.closeBlock(); this.flagFirstMemberWritten(true); } diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts index 1d30359fee..b1277d2cf5 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts @@ -50,7 +50,7 @@ export class FileGenerator { const rootNode = xmlbuilder.create('Project', { encoding: 'UTF-8', headless: true }); rootNode.att('Sdk', 'Microsoft.NET.Sdk'); const propertyGroup = rootNode.ele('PropertyGroup'); - propertyGroup.ele('TargetFramework', 'netcoreapp2.1'); + propertyGroup.ele('TargetFrameworks', 'netcoreapp2.1;netcoreapp3.0'); propertyGroup.ele('GeneratePackageOnBuild', 'true'); propertyGroup.ele('GenerateDocumentationFile', 'true'); propertyGroup.ele('IncludeSymbols', 'true'); diff --git a/packages/jsii-pacmak/lib/targets/java.ts b/packages/jsii-pacmak/lib/targets/java.ts index 5fd838b167..b497a9eadc 100644 --- a/packages/jsii-pacmak/lib/targets/java.ts +++ b/packages/jsii-pacmak/lib/targets/java.ts @@ -538,13 +538,25 @@ class JavaGenerator extends Generator { this.code.line(); this.addJavaDocs(prop); this.emitStabilityAnnotations(prop); - this.code.line(`${getterType} get${propName}();`); + if (prop.optional) { + this.code.openBlock(`default ${getterType} get${propName}()`); + this.code.line('return null;'); + this.code.closeBlock(); + } else { + this.code.line(`${getterType} get${propName}();`); + } if (!prop.immutable) { for (const type of setterTypes) { this.code.line(); this.addJavaDocs(prop); - this.code.line(`void set${propName}(final ${type} value);`); + if (prop.optional) { + this.code.openBlock(`default void set${propName}(final ${type} value)`); + this.code.line(`throw new RuntimeException("'void " + getClass().getCanonicalName() + "#set${propName}(${type})' is not implemented!");`); + this.code.closeBlock(); + } else { + this.code.line(`void set${propName}(final ${type} value);`); + } } } } diff --git a/packages/jsii-pacmak/test/diff-test.sh b/packages/jsii-pacmak/test/diff-test.sh index 39d7efc78f..12f29b0963 100755 --- a/packages/jsii-pacmak/test/diff-test.sh +++ b/packages/jsii-pacmak/test/diff-test.sh @@ -29,11 +29,6 @@ function assert-generator() { rsync -a ${original_expected}/ ${expected}/ fi - if [[ -d ${original_expected}/java/target ]]; then - echo "An IDE plugin seems to have eagerly tried to compile ${original_expected}/java. Please remove." >&2 - exit 1 - fi - # put the real expected tarball instead of the placeholder for expected_tarball_placeholder in $(find ${expected} -name "*.tgz" || true); do rm -f ${expected_tarball_placeholder} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj index dde4b3b9ff..5f349696ea 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj @@ -1,6 +1,6 @@ - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.0 true true true diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj index 148b43a8b0..c1f8befbe1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj @@ -1,6 +1,6 @@ - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.0 true true true diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs index f5681f0998..a10d7cf242 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs @@ -39,7 +39,14 @@ string Astring [System.Obsolete()] string[] FirstOptional { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs index 23413fa7ef..fad069d9a7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs @@ -18,7 +18,14 @@ public interface IStructWithOnlyOptionals [System.Obsolete()] string Optional1 { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -28,7 +35,14 @@ string Optional1 [System.Obsolete()] double? Optional2 { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -38,7 +52,14 @@ string Optional1 [System.Obsolete()] bool? Optional3 { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/MyFirstStruct.java b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/MyFirstStruct.java index 48581d9b99..f3f0414138 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/MyFirstStruct.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/MyFirstStruct.java @@ -26,7 +26,9 @@ public interface MyFirstStruct extends software.amazon.jsii.JsiiSerializable { */ @Deprecated @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) - java.util.List getFirstOptional(); + default java.util.List getFirstOptional() { + return null; + } /** * @return a {@link Builder} of {@link MyFirstStruct} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/StructWithOnlyOptionals.java b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/StructWithOnlyOptionals.java index e850573ede..78949c2d0e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/StructWithOnlyOptionals.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/src/main/java/software/amazon/jsii/tests/calculator/lib/StructWithOnlyOptionals.java @@ -13,19 +13,25 @@ public interface StructWithOnlyOptionals extends software.amazon.jsii.JsiiSerial */ @Deprecated @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) - java.lang.String getOptional1(); + default java.lang.String getOptional1() { + return null; + } /** */ @Deprecated @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) - java.lang.Number getOptional2(); + default java.lang.Number getOptional2() { + return null; + } /** */ @Deprecated @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) - java.lang.Boolean getOptional3(); + default java.lang.Boolean getOptional3() { + return null; + } /** * @return a {@link Builder} of {@link StructWithOnlyOptionals} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj index 4a859586a5..06ab4f9db1 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj @@ -1,6 +1,6 @@ - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.0 true true true diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs index 5c7915c541..c96585ec3b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs @@ -15,7 +15,14 @@ public interface ICalculatorProps [JsiiProperty(name: "initialValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? InitialValue { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -24,7 +31,14 @@ public interface ICalculatorProps [JsiiProperty(name: "maximumValue", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? MaximumValue { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDeprecatedInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDeprecatedInterface.cs index 548b659527..9680bd3beb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDeprecatedInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDeprecatedInterface.cs @@ -16,8 +16,19 @@ public interface IDeprecatedInterface [System.Obsolete("could be better")] double? MutableProperty { + #if NETCOREAPP3_0 + get + { + return null; + } + set + { + throw new System.NotSupportedException("'set' for 'MutableProperty' is not implemented"); + } + #else get; set; + #endif } /// /// stability: Deprecated diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs index c757d31530..f51b91e222 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs @@ -44,7 +44,14 @@ Amazon.JSII.Tests.CalculatorNamespace.DoubleTrouble NonPrimitive [JsiiProperty(name: "anotherOptional", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"},\"kind\":\"map\"}}", isOptional: true)] System.Collections.Generic.IDictionary AnotherOptional { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -53,7 +60,14 @@ Amazon.JSII.Tests.CalculatorNamespace.DoubleTrouble NonPrimitive [JsiiProperty(name: "optionalAny", typeJson: "{\"primitive\":\"any\"}", isOptional: true)] object OptionalAny { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -62,7 +76,14 @@ object OptionalAny [JsiiProperty(name: "optionalArray", typeJson: "{\"collection\":{\"elementtype\":{\"primitive\":\"string\"},\"kind\":\"array\"}}", isOptional: true)] string[] OptionalArray { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs index 979958786b..a99d607ffd 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IEraseUndefinedHashValuesOptions.cs @@ -14,7 +14,14 @@ public interface IEraseUndefinedHashValuesOptions [JsiiProperty(name: "option1", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Option1 { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -23,7 +30,14 @@ string Option1 [JsiiProperty(name: "option2", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Option2 { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExperimentalInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExperimentalInterface.cs index b1a6cf5cc9..8651330e15 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExperimentalInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IExperimentalInterface.cs @@ -14,8 +14,19 @@ public interface IExperimentalInterface [JsiiProperty(name: "mutableProperty", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? MutableProperty { + #if NETCOREAPP3_0 + get + { + return null; + } + set + { + throw new System.NotSupportedException("'set' for 'MutableProperty' is not implemented"); + } + #else get; set; + #endif } /// /// stability: Experimental diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs index c82087b6db..0e11e18234 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IGreetee.cs @@ -18,7 +18,14 @@ public interface IGreetee [JsiiProperty(name: "name", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Name { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs index d0452eb2df..6afbb9e4db 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs @@ -19,7 +19,14 @@ public interface ILoadBalancedFargateServiceProps [JsiiProperty(name: "containerPort", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? ContainerPort { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments. @@ -32,7 +39,14 @@ public interface ILoadBalancedFargateServiceProps [JsiiProperty(name: "cpu", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Cpu { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// The amount (in MiB) of memory used by the task. @@ -58,7 +72,14 @@ string Cpu [JsiiProperty(name: "memoryMiB", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string MemoryMiB { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// Determines whether the Application Load Balancer will be internet-facing. @@ -70,7 +91,14 @@ string MemoryMiB [JsiiProperty(name: "publicLoadBalancer", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] bool? PublicLoadBalancer { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// Determines whether your Fargate Service will be assigned a public IP address. @@ -82,7 +110,14 @@ string MemoryMiB [JsiiProperty(name: "publicTasks", typeJson: "{\"primitive\":\"boolean\"}", isOptional: true)] bool? PublicTasks { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs index f2cda4473b..d2d0ce1918 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs @@ -23,7 +23,14 @@ object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument [JsiiProperty(name: "thisShouldBeUndefined", typeJson: "{\"primitive\":\"any\"}", isOptional: true)] object ThisShouldBeUndefined { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs index 6fed1c1d17..d9a28b8d0b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IOptionalStruct.cs @@ -14,7 +14,14 @@ public interface IOptionalStruct [JsiiProperty(name: "field", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Field { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ISecondLevelStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ISecondLevelStruct.cs index cbf60a85ee..64c29e3199 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ISecondLevelStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ISecondLevelStruct.cs @@ -25,7 +25,14 @@ string DeeperRequiredProp [JsiiProperty(name: "deeperOptionalProp", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string DeeperOptionalProp { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStableInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStableInterface.cs index c28a6624ad..8a281bc311 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStableInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStableInterface.cs @@ -14,8 +14,19 @@ public interface IStableInterface [JsiiProperty(name: "mutableProperty", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? MutableProperty { + #if NETCOREAPP3_0 + get + { + return null; + } + set + { + throw new System.NotSupportedException("'set' for 'MutableProperty' is not implemented"); + } + #else get; set; + #endif } /// /// stability: Stable diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStructWithJavaReservedWords.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStructWithJavaReservedWords.cs index 82b77c4bb3..eee11b2a93 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStructWithJavaReservedWords.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IStructWithJavaReservedWords.cs @@ -23,7 +23,14 @@ string Default [JsiiProperty(name: "assert", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Assert { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -32,7 +39,14 @@ string Assert [JsiiProperty(name: "result", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Result { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } /// @@ -41,7 +55,14 @@ string Result [JsiiProperty(name: "that", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string That { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ITopLevelStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ITopLevelStruct.cs index cacaf15a97..5e3b1787cd 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ITopLevelStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ITopLevelStruct.cs @@ -35,7 +35,14 @@ object SecondLevel [JsiiProperty(name: "optional", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Optional { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs index ffed2786ba..51f72cc72d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs @@ -23,7 +23,14 @@ object Bar [JsiiProperty(name: "foo", typeJson: "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]}}", isOptional: true)] object Foo { + #if NETCOREAPP3_0 + get + { + return null; + } + #else get; + #endif } } } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/CalculatorProps.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/CalculatorProps.java index 56b53e27f5..edec2a00f8 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/CalculatorProps.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/CalculatorProps.java @@ -13,13 +13,17 @@ public interface CalculatorProps extends software.amazon.jsii.JsiiSerializable { * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Number getInitialValue(); + default java.lang.Number getInitialValue() { + return null; + } /** * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Number getMaximumValue(); + default java.lang.Number getMaximumValue() { + return null; + } /** * @return a {@link Builder} of {@link CalculatorProps} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DerivedStruct.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DerivedStruct.java index 9ef12b74a6..478af8702e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DerivedStruct.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/DerivedStruct.java @@ -35,19 +35,25 @@ public interface DerivedStruct extends software.amazon.jsii.JsiiSerializable, so * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.util.Map getAnotherOptional(); + default java.util.Map getAnotherOptional() { + return null; + } /** * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Object getOptionalAny(); + default java.lang.Object getOptionalAny() { + return null; + } /** * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.util.List getOptionalArray(); + default java.util.List getOptionalArray() { + return null; + } /** * @return a {@link Builder} of {@link DerivedStruct} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/EraseUndefinedHashValuesOptions.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/EraseUndefinedHashValuesOptions.java index ebc4b4549a..67422c0aa8 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/EraseUndefinedHashValuesOptions.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/EraseUndefinedHashValuesOptions.java @@ -11,13 +11,17 @@ public interface EraseUndefinedHashValuesOptions extends software.amazon.jsii.Js * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getOption1(); + default java.lang.String getOption1() { + return null; + } /** * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getOption2(); + default java.lang.String getOption2() { + return null; + } /** * @return a {@link Builder} of {@link EraseUndefinedHashValuesOptions} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/Greetee.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/Greetee.java index 2f1cd911f2..31080ca6ee 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/Greetee.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/Greetee.java @@ -17,7 +17,9 @@ public interface Greetee extends software.amazon.jsii.JsiiSerializable { * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getName(); + default java.lang.String getName() { + return null; + } /** * @return a {@link Builder} of {@link Greetee} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IDeprecatedInterface.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IDeprecatedInterface.java index f98a494aa7..27ae084320 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IDeprecatedInterface.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IDeprecatedInterface.java @@ -13,12 +13,16 @@ public interface IDeprecatedInterface extends software.amazon.jsii.JsiiSerializa */ @Deprecated @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) - java.lang.Number getMutableProperty(); + default java.lang.Number getMutableProperty() { + return null; + } /** * @deprecated could be better */ - void setMutableProperty(final java.lang.Number value); + default void setMutableProperty(final java.lang.Number value) { + throw new RuntimeException("'void " + getClass().getCanonicalName() + "#setMutableProperty(java.lang.Number)' is not implemented!"); + } /** * @deprecated services no purpose diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IExperimentalInterface.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IExperimentalInterface.java index 28a772b678..3ec95d2b1c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IExperimentalInterface.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IExperimentalInterface.java @@ -11,12 +11,16 @@ public interface IExperimentalInterface extends software.amazon.jsii.JsiiSeriali * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Number getMutableProperty(); + default java.lang.Number getMutableProperty() { + return null; + } /** * EXPERIMENTAL */ - void setMutableProperty(final java.lang.Number value); + default void setMutableProperty(final java.lang.Number value) { + throw new RuntimeException("'void " + getClass().getCanonicalName() + "#setMutableProperty(java.lang.Number)' is not implemented!"); + } /** * EXPERIMENTAL diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IStableInterface.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IStableInterface.java index f068c80dc9..520b4f06f2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IStableInterface.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/IStableInterface.java @@ -9,11 +9,15 @@ public interface IStableInterface extends software.amazon.jsii.JsiiSerializable /** */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) - java.lang.Number getMutableProperty(); + default java.lang.Number getMutableProperty() { + return null; + } /** */ - void setMutableProperty(final java.lang.Number value); + default void setMutableProperty(final java.lang.Number value) { + throw new RuntimeException("'void " + getClass().getCanonicalName() + "#setMutableProperty(java.lang.Number)' is not implemented!"); + } /** */ diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/LoadBalancedFargateServiceProps.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/LoadBalancedFargateServiceProps.java index bbd612596d..1f4fe750ac 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/LoadBalancedFargateServiceProps.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/LoadBalancedFargateServiceProps.java @@ -19,7 +19,9 @@ public interface LoadBalancedFargateServiceProps extends software.amazon.jsii.Js * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Number getContainerPort(); + default java.lang.Number getContainerPort() { + return null; + } /** * The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments. @@ -31,7 +33,9 @@ public interface LoadBalancedFargateServiceProps extends software.amazon.jsii.Js * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getCpu(); + default java.lang.String getCpu() { + return null; + } /** * The amount (in MiB) of memory used by the task. @@ -56,7 +60,9 @@ public interface LoadBalancedFargateServiceProps extends software.amazon.jsii.Js * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getMemoryMiB(); + default java.lang.String getMemoryMiB() { + return null; + } /** * Determines whether the Application Load Balancer will be internet-facing. @@ -66,7 +72,9 @@ public interface LoadBalancedFargateServiceProps extends software.amazon.jsii.Js * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Boolean getPublicLoadBalancer(); + default java.lang.Boolean getPublicLoadBalancer() { + return null; + } /** * Determines whether your Fargate Service will be assigned a public IP address. @@ -76,7 +84,9 @@ public interface LoadBalancedFargateServiceProps extends software.amazon.jsii.Js * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Boolean getPublicTasks(); + default java.lang.Boolean getPublicTasks() { + return null; + } /** * @return a {@link Builder} of {@link LoadBalancedFargateServiceProps} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/NullShouldBeTreatedAsUndefinedData.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/NullShouldBeTreatedAsUndefinedData.java index 0cc86a97de..d4abffa9b3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/NullShouldBeTreatedAsUndefinedData.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/NullShouldBeTreatedAsUndefinedData.java @@ -17,7 +17,9 @@ public interface NullShouldBeTreatedAsUndefinedData extends software.amazon.jsii * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Object getThisShouldBeUndefined(); + default java.lang.Object getThisShouldBeUndefined() { + return null; + } /** * @return a {@link Builder} of {@link NullShouldBeTreatedAsUndefinedData} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/OptionalStruct.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/OptionalStruct.java index 08f72989ff..4ecf71d049 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/OptionalStruct.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/OptionalStruct.java @@ -11,7 +11,9 @@ public interface OptionalStruct extends software.amazon.jsii.JsiiSerializable { * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getField(); + default java.lang.String getField() { + return null; + } /** * @return a {@link Builder} of {@link OptionalStruct} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SecondLevelStruct.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SecondLevelStruct.java index b8608b560a..0b65b9dfbd 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SecondLevelStruct.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/SecondLevelStruct.java @@ -21,7 +21,9 @@ public interface SecondLevelStruct extends software.amazon.jsii.JsiiSerializable * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getDeeperOptionalProp(); + default java.lang.String getDeeperOptionalProp() { + return null; + } /** * @return a {@link Builder} of {@link SecondLevelStruct} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StructWithJavaReservedWords.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StructWithJavaReservedWords.java index 4ec8701f2c..ba8ebc1d61 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StructWithJavaReservedWords.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/StructWithJavaReservedWords.java @@ -17,19 +17,25 @@ public interface StructWithJavaReservedWords extends software.amazon.jsii.JsiiSe * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getAssertValue(); + default java.lang.String getAssertValue() { + return null; + } /** * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getResult(); + default java.lang.String getResult() { + return null; + } /** * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getThat(); + default java.lang.String getThat() { + return null; + } /** * @return a {@link Builder} of {@link StructWithJavaReservedWords} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/TopLevelStruct.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/TopLevelStruct.java index d697f1e156..11fc51a439 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/TopLevelStruct.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/TopLevelStruct.java @@ -29,7 +29,9 @@ public interface TopLevelStruct extends software.amazon.jsii.JsiiSerializable { * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.String getOptional(); + default java.lang.String getOptional() { + return null; + } /** * @return a {@link Builder} of {@link TopLevelStruct} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/UnionProperties.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/UnionProperties.java index 3e0bb49b73..9af45426cb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/UnionProperties.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/UnionProperties.java @@ -17,7 +17,9 @@ public interface UnionProperties extends software.amazon.jsii.JsiiSerializable { * EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) - java.lang.Object getFoo(); + default java.lang.Object getFoo() { + return null; + } /** * @return a {@link Builder} of {@link UnionProperties}