The type we pass in is ConjureAnnotations.withSafety(<underlying type>) and if you have any safety annotations, you end up with a TypeName.Doublewith annotations on top which are not equal to TypeName.Double, hence why we're hitting the second block.
This was the confusing part as AliasDoubleExample was actually generating the correct output.
After this PR
==COMMIT_MSG==
Ensure that Aliased Double types with specified log safety have a correct equalTo.
==COMMIT_MSG==
added a new example type and you can see the incorrect generated code.
added a convenience method, Primitives#isDouble so don't have to remember to remove annotations etc.
What do the change types mean?
- `feature`: A new feature of the service.
- `improvement`: An incremental improvement in the functionality or operation of the service.
- `fix`: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
- `break`: Has the potential to break consumers of this service's API, inclusive of both Palantir services
and external consumers of the service's API (e.g. customer-written software or integrations).
- `deprecation`: Advertises the intention to remove service functionality without any change to the
operation of the service itself.
- `manualTask`: Requires the possibility of manual intervention (running a script, eyeballing configuration,
performing database surgery, ...) at the time of upgrade for it to succeed.
- `migration`: A fully automatic upgrade migration task with no engineer input required.
_Note: only one type should be chosen._
How are new versions calculated?
- ❗The `break` and `manual task` changelog types will result in a major release!
- 🐛 The `fix` changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
- ✨ All others will result in a minor version release.
Ensure that Aliased `Double` types with specified log safety have a correct `equalTo`.
**Check the box to generate changelog(s)**
- [x] Generate changelog entry
Before this PR
After #2291 merged, some tests started failing in a specific case of an aliased
Double
that had safety annotations on.The
equalTo
method was now generating something like this:https://github.com/palantir/conjure-java/blob/7891d80363baa9843cc75b39b8a04d1430be1a2e/conjure-java-core/src/main/java/com/palantir/conjure/java/types/MethodSpecs.java#L93-L97
The type we pass in is
ConjureAnnotations.withSafety(<underlying type>)
and if you have any safety annotations, you end up with aTypeName.Double
with annotations on top which are not equal toTypeName.Double
, hence why we're hitting the second block.This was the confusing part as
AliasDoubleExample
was actually generating the correct output.After this PR
==COMMIT_MSG== Ensure that Aliased
Double
types with specified log safety have a correctequalTo
. ==COMMIT_MSG==added a new example type and you can see the incorrect generated code.
added a convenience method,
Primitives#isDouble
so don't have to remember to remove annotations etc.Possible downsides?