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

Default implementations for redundant PropertyRequiresPlugin methods #361

Merged
merged 1 commit into from
Jul 3, 2023
Merged

Default implementations for redundant PropertyRequiresPlugin methods #361

merged 1 commit into from
Jul 3, 2023

Conversation

Mechite
Copy link
Contributor

@Mechite Mechite commented Jul 3, 2023

Creates some default implementations returning the opposite of contains and equalTo for their opposing redundant methods.
I don't know why these are here, and perhaps they don't serve a purpose and their usages can be migrated to, well, the opposite of contains and equalTo.

Copy link
Collaborator

@SentryMan SentryMan left a comment

Choose a reason for hiding this comment

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

LGTM

@rbygrave
Copy link
Contributor

rbygrave commented Jul 3, 2023

their usages can be migrated to, well, the opposite of contains and equalTo.

Technically this is valid - we could do that.

As I see it, the main reason why we would not do that and stick to missing() and notEqualTo() is because that can be deemed easier to read than the more subtle !.

Example: missing()

    if (builder.contains(Kiwi.class)
      || builder.property().missing("finch-time")
      || builder.property().contains("secondary")) {
      return;
    }

vs !

    if (builder.contains(Kiwi.class)
      || !builder.property().contains("finch-time")
      || builder.property().contains("secondary")) {
      return;
    }

So I think we merge this in - this is definitely an improvement.

There is a followup of if we stop using missing() and notEqualTo() and use ! - is that too subtle / harder to read the generated code etc.

@rbygrave rbygrave added this to the 9.3 milestone Jul 3, 2023
@rbygrave rbygrave merged commit 4188620 into avaje:master Jul 3, 2023
3 checks passed
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

3 participants