In the following case, the
interface IBaseInterface {
readonly value: string;
doSomething(): void;
}
interface IDerivedInterface extends IBaseInterface {
readonly otherValue: string;
}
The interface IDerivedInterface is incorrectly marked as {datatype: true}, because the interface consists only of properties. Correct behavior would have been to take the parent interfaces into account as well while making this assessment.
This leads the Java code generator to emit a Builder that contains duplicate fields (and setters) and ignoring the methods in the upstream classes (encountered while making an IRole interface):
@aws-cdk/aws-iam: [ERROR] /tmp/jsii-pacmak-codeUbHgJB/src/main/java/software/amazon/awscdk/services/iam/IRole.java:[26,69] variable _principal is already defined in class software.amazon.awscdk.services.iam.IRole.Builder
@aws-cdk/aws-iam: [ERROR] /tmp/jsii-pacmak-codeUbHgJB/src/main/java/software/amazon/awscdk/services/iam/IRole.java:[52,24] method withPrincipal(software.amazon.awscdk.services.iam.PolicyPrincipal) is already defined in class software.amazon.awscdk.services.iam.IRole.Builder
@aws-cdk/aws-iam: [ERROR] /tmp/jsii-pacmak-codeUbHgJB/src/main/java/software/amazon/awscdk/services/iam/IRole.java:[76,83] variable $principal is already defined in class <anonymous software.amazon.awscdk.services.iam.IRole$Builder$1>
@aws-cdk/aws-iam: [ERROR] /tmp/jsii-pacmak-codeUbHgJB/src/main/java/software/amazon/awscdk/services/iam/IRole.java:[90,76] method getPrincipal() is already defined in class <anonymous software.amazon.awscdk.services.iam.IRole$Builder$1>
@aws-cdk/aws-iam: [ERROR] /tmp/jsii-pacmak-codeUbHgJB/src/main/java/software/amazon/awscdk/services/iam/IRole.java:[73,32] <anonymous software.amazon.awscdk.services.iam.IRole$Builder$1> is not abstract and does not override abstract method attachManagedPolicy(java.lang.String) in software.amazon.awscdk.services.iam.IPrincipal
In the following case, the
The interface
IDerivedInterfaceis incorrectly marked as{datatype: true}, because the interface consists only of properties. Correct behavior would have been to take the parent interfaces into account as well while making this assessment.This leads the Java code generator to emit a Builder that contains duplicate fields (and setters) and ignoring the methods in the upstream classes (encountered while making an
IRoleinterface):