Skip to content

Conversation

@carterkozak
Copy link
Contributor

For example:

@Value.Immutable
interface Context {
  AuthService authService();

  // not a field, only a utility method
  default BearerToken token() {
    return authService().currentToken();
  }
}

==COMMIT_MSG==
Safety propagation ignores utility methods on immutables definitions
==COMMIT_MSG==

For example:
```
@Value.Immutable
interface Context {
  AuthService authService();

  // not a field, only a utility method
  default BearerToken token() {
    return authService().currentToken();
  }
}
```
@changelog-app
Copy link

changelog-app bot commented Apr 28, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Safety propagation ignores utility methods on immutables definitions

Check the box to generate changelog(s)

  • Generate changelog entry

}

@Test
void testIgnoresJsonIgnoreHelperMethod() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

this test would have been an ignore even without the JsonIgnore annotation. Is it worth a version of this test that would actually propagate the method safety annotaiton to the class if the JsonIgnore wasn't there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add another test with a jsonignored field, however we do want to include those in safety because they're included in the toString.

@bulldozer-bot bulldozer-bot bot merged commit d828a8e into develop Apr 28, 2022
@bulldozer-bot bulldozer-bot bot deleted the ckozak/propagation_ignores_private_immutables_methods branch April 28, 2022 21:17
@svc-autorelease
Copy link
Collaborator

Released 4.121.0

bulldozer-bot bot pushed a commit to palantir/witchcraft-api that referenced this pull request Apr 29, 2022
###### _excavator_ is a bot for automating changes across repositories.

Changes produced by the roomba/latest-baseline-oss check.

# Release Notes
## 4.121.0
| Type | Description | Link |
| ---- | ----------- | ---- |
| Improvement | Safety propagation ignores utility methods on immutables definitions | palantir/gradle-baseline#2237 |



To enable or disable this check, please contact the maintainers of Excavator.
This was referenced Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants