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

Use ICloneable in generated code #2044

Merged
merged 17 commits into from
Apr 27, 2023
Merged

Use ICloneable in generated code #2044

merged 17 commits into from
Apr 27, 2023

Conversation

mregen
Copy link
Contributor

@mregen mregen commented Jan 8, 2023

Proposed changes

  • ICloneable was removed from generated code for the first port to .NET Standard 1.x, instead MemberwiseClone was used
  • Reenable ICloneable for generated code
  • Add ICloneable to built in types

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

@mregen mregen added this to the 1.4.371.50 Bug fixes milestone Jan 8, 2023
@mregen mregen marked this pull request as draft January 8, 2023 06:57
@codecov
Copy link

codecov bot commented Jan 8, 2023

Codecov Report

Merging #2044 (e9792e4) into master (ae7f8e5) will decrease coverage by 0.22%.
The diff coverage is 38.02%.

@@            Coverage Diff             @@
##           master    #2044      +/-   ##
==========================================
- Coverage   58.18%   57.96%   -0.22%     
==========================================
  Files         324      324              
  Lines       61743    61677      -66     
==========================================
- Hits        35926    35752     -174     
- Misses      25817    25925     +108     
Impacted Files Coverage Δ
Libraries/Opc.Ua.PubSub/PublishedData/DataSet.cs 15.38% <0.00%> (-1.29%) ⬇️
Libraries/Opc.Ua.PubSub/PublishedData/Field.cs 0.00% <0.00%> (ø)
...braries/Opc.Ua.Server/Server/ServerInternalData.cs 89.10% <ø> (ø)
...ore/Security/Certificates/CertificateIdentifier.cs 25.99% <0.00%> (-0.12%) ⬇️
...ecurity/Certificates/CertificateStoreIdentifier.cs 80.39% <0.00%> (-1.61%) ⬇️
...Ua.Core/Stack/Configuration/ConfiguredEndpoints.cs 24.53% <0.00%> (-0.12%) ⬇️
...ck/Opc.Ua.Core/Stack/Generated/Opc.Ua.DataTypes.cs 100.00% <ø> (ø)
Stack/Opc.Ua.Core/Types/BuiltIn/StatusCode.cs 41.12% <0.00%> (-0.39%) ⬇️
Stack/Opc.Ua.Core/Types/BuiltIn/Uuid.cs 71.42% <0.00%> (-2.11%) ⬇️
...tack/Opc.Ua.Core/Types/Encoders/EncodableObject.cs 0.00% <0.00%> (ø)
... and 20 more

... and 14 files with indirect coverage changes

@mregen mregen modified the milestones: 1.4.371.50 Bug fixes, 1.4.372 Jan 8, 2023
@mregen mregen requested a review from mrsuciu February 24, 2023 08:48
@mregen mregen marked this pull request as ready for review February 25, 2023 11:09
@mregen
Copy link
Contributor Author

mregen commented Feb 25, 2023

Marked as draft until gates open for 1.4.372 PR...

@mregen mregen marked this pull request as draft February 25, 2023 11:13
@mregen mregen self-assigned this Feb 27, 2023
@mregen mregen requested a review from salihgoncu March 9, 2023 16:39
Copy link
Contributor

@salihgoncu salihgoncu left a comment

Choose a reason for hiding this comment

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

the changes seem to be alright in my opinion. One comment would be, hiding MemberwiseClone may have adverse effects as it is intended to do a shallow copy, instead of a deep copy that we intend to make here. Other than that, all look fine.

@mregen mregen marked this pull request as ready for review April 27, 2023 06:34
@mregen mregen merged commit 24845eb into master Apr 27, 2023
71 of 73 checks passed
@mregen mregen deleted the useicloneable branch April 27, 2023 09:08
@@ -1482,7 +1482,7 @@ public void FetchNamespaceTables()
ResponseHeader responseHeader = this.Read(
null,
0,
TimestampsToReturn.Both,
Copy link

Choose a reason for hiding this comment

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

Is this change intended?
Seems to have nothing to do with IClone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats correct. Intended yes, but not for IClone. Thanks for checking...

Copy link

Choose a reason for hiding this comment

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

Just to clarify:
This change was already merged to the master branch. There I have seen it.
I do not know if this is a problem, i just wanted to give notification to prevent mistakes.

Copy link
Contributor Author

@mregen mregen May 4, 2023

Choose a reason for hiding this comment

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

Its a tiny optimization, because the timestamps are not needed here.

Copy link

Choose a reason for hiding this comment

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

Ok, thanks.

TimJoehnk pushed a commit to TimJoehnk/UA-.NETStandard that referenced this pull request Aug 4, 2023
- ICloneable was removed from generated code for the first port to .NET Standard 1.x, instead MemberwiseClone was used
- Reenable ICloneable for generated code
- Add ICloneable to built in types
- Fix code where MemberwiseClone is called instead of Clone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants