Skip to content

Conversation

@pkwarren
Copy link
Member

As part of refactoring, the previous internal package (where the validator implementation is found) was refactored to the build.buf.protovalidate package. As part of this change, we should ensure that all previously internal classes are final (to prevent subclassing) and that methods not overridden from an interface use package private or lower visibility.

As part of refactoring, the previous internal package (where the
validator implementation is found) was refactored to the
build.buf.protovalidate package. As part of this change, we should
ensure that all previously internal classes are final (to prevent
subclassing) and that methods not overridden from an interface use
package private or lower visibility.
@pkwarren pkwarren requested review from a user, smaye81 and srikrsna-buf June 11, 2025 22:26
final class RuleViolation implements Violation {
/** Static value to return when there are no violations. */
public static final List<Builder> NO_VIOLATIONS = new ArrayList<>();
static final List<Builder> NO_VIOLATIONS = Collections.emptyList();
Copy link
Member Author

@pkwarren pkwarren Jun 11, 2025

Choose a reason for hiding this comment

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

If for any reason someone mutated this list that would've been bad. This should also be faster and use less memory if there are no violations.

@pkwarren pkwarren merged commit 546b7b6 into main Jun 12, 2025
4 checks passed
@pkwarren pkwarren deleted the pkw/reduce-visibility branch June 12, 2025 00:49
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