Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(java,dotnet): abstract properties have concrete implementations #1128

Merged
merged 5 commits into from
Dec 19, 2019

Conversation

RomainMuller
Copy link
Contributor

The generated code for abstract properties in Java and C# included fully
concrete implementations, instead of an abstract declaration. This made
it possible to subclass those types without actually implementing those
members, resulting in invalid code.

This changes the code generation to actually emit the abstract keyword
and not generate a full concrete implementation.

Fixes #240
Fixes #1011


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The generated code for abstract properties in Java and C# included fully
concrete implementations, instead of an abstract declaration. This made
it possible to subclass those types without actually implementing those
members, resulting in invalid code.

This changes the code generation to actually emit the `abstract` keyword
and not generate a full concrete implementation.

Fixes #240
Fixes #1011
@RomainMuller
Copy link
Contributor Author

This is currently marked as draft because I still have to double-check whether existing test coverage is sufficient to ensure this "works as-is" or not.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@RomainMuller RomainMuller marked this pull request as ready for review December 17, 2019 10:55
@RomainMuller RomainMuller requested review from MrArnoldPalmer and a team as code owners December 17, 2019 10:55
@RomainMuller
Copy link
Contributor Author

Added tests (and fixed the issues they uncovered in the .NET runtime...)

@RomainMuller RomainMuller removed the request for review from MrArnoldPalmer December 17, 2019 10:56
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

/// </remarks>
[JsiiMethod(name: "someMethod", returnsJson: "{\"type\":{\"primitive\":\"string\"}}", parametersJson: "[{\"name\":\"str\",\"type\":{\"primitive\":\"string\"}}]")]
protected abstract string SomeMethod(string str);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline here.

@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2019

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2019

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Dec 19, 2019
@mergify mergify bot merged commit c9351a3 into master Dec 19, 2019
@mergify mergify bot deleted the rmuller/abstract branch December 19, 2019 08:58
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants