Skip to content

Add warning message for exclusion of mixin members using transform #2644

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joewyz
Copy link
Contributor

@joewyz joewyz commented May 20, 2025

Background

  • Add warning log for exclusion of mixin members using transform.
  • Modify the related docs to discourage customer to exclude mixin members explicity.

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

@joewyz joewyz requested a review from a team as a code owner May 20, 2025 07:44
@joewyz joewyz requested a review from yefrig May 20, 2025 07:44
return new RemoveShapes(shapes, plugins).transform(this, model);
}

private void validateMembersFromMixin(Model model, Collection<? extends Shape> shapesToExclude) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's be consistent with the calling method and name the arguments the same.

Suggested change
private void validateMembersFromMixin(Model model, Collection<? extends Shape> shapesToExclude) {
private void validateMembersFromMixin(Model model, Collection<? extends Shape> shapes) {

Comment on lines 138 to 142
LOGGER.warning(format("Excluding copied mixin member `%s` from mixin shape `%s` explicitly "
+ "in `%s` will result in undefined behavior and an inconsistent model!",
memberShape.getMemberName(),
mixinShape.getId(),
container.get().getId().getName()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LOGGER.warning(format("Excluding copied mixin member `%s` from mixin shape `%s` explicitly "
+ "in `%s` will result in undefined behavior and an inconsistent model!",
memberShape.getMemberName(),
mixinShape.getId(),
container.get().getId().getName()));
LOGGER.warning(format("Excluding member `%s` from mixin shape `%s` "
+ "in `%s` will result in an inconsistent model",
memberShape.getMemberName(),
mixinShape.getId(),
container.get().getId().getName()));

@joewyz joewyz force-pushed the joewyz/exclude-by-trait-fix branch from 34ca331 to 5f7860d Compare May 28, 2025 18:31
@sugmanue sugmanue self-requested a review May 28, 2025 21:40
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.

2 participants