-
Notifications
You must be signed in to change notification settings - Fork 301
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
Release 0.23.1 #818
Merged
Merged
Release 0.23.1 #818
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: codecholeric <action@github.com>
Signed-off-by: codecholeric <action@github.com> Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
This task depends on the compiled output of the `compileJava` task, so we should explicitly declare this dependency. Otherwise, if you just run `compileJdk9mainJava` on a clean build it breaks. Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
In the end this is not relevant for most users which will be happy with the default configuration and do not need to get into the depths of tweaking specific resolutions. Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
With ArchUnit 0.23.0 we fixed an ambiguity problem when resolving method call origins (bridge methods would cause two methods with same name and parameter types, so we would pick one randomly, which could be the wrong/synthetic one). Unfortunately, this broke some Kotlin use cases, because inline functions would cause the compiler to create synthetic classes with methods where the `signature` and the `descriptor` do not match (e.g. the signature says the return type is `String`, but the descriptor claims `Object`). In these cases the erasure of the generic type does not match the raw type. But so far for the return type we derived the raw return type as erasure from the generic return type. This is now fixed by keeping raw and generic return type completely separate, since we obviously cannot derive one from the other (the JVM spec also clearly states that this is a valid case, that descriptor and signature do not need to match exactly and are not validated against each other). Note that for parameter types we have already separated this a while ago, so there it never was a problem. Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
Since we meanwhile have the descriptor both on the search target and the code unit candidates, we can simply compare that instead of comparing raw parameter types and return type individually. Note that this by itself would have already fixed the bug where call origins cannot be identified if descriptor and signature mismatch, but nevertheless the API would have been behaving wrongly when deriving the raw return type from the erasure of the generic return type. Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
…smatch #812 With ArchUnit `0.23.0` we fixed an ambiguity problem when resolving method call origins (bridge methods would cause two methods with same name and parameter types, so we would pick one randomly, which could be the wrong/synthetic one). Unfortunately, this broke some Kotlin use cases, because inline functions would cause the compiler to create synthetic classes with methods where the signature and the descriptor do not match (e.g. the signature says the return type is String, but the descriptor claims Object). In these cases the erasure of the generic type does not match the raw type. But so far for the return type we derived the raw return type as erasure from the generic return type. This is now fixed by keeping raw and generic return type completely separate, since we obviously cannot derive one from the other (the JVM spec also clearly states that this is a valid case, that descriptor and signature do not need to match exactly and are not validated against each other).
For all properties except for `optionalLayers` we have followed the pattern of immutability, we should do the same here. Technically this is a breaking change, but since this immutability is the usual pattern that ArchUnit follows everywhere else, and the fluent API invites to simply chain these methods anyway, the risk is probably low. Signed-off-by: Peter Gafert <peter.gafert@tngtech.com> (cherry picked from commit 3e54892)
It turned out to be a bad idea to override the default configuration for `archRule.failOnEmptyShould=false` for all tests, since that covered up the fact that the default configuration actually breaks `optionalLayers` for `LayeredArchitecture` and `OnionArchitecture`. We now also use the default configuration for tests and override it on an individual basis. Note that we should use the default config for `ArchitecturesTest`, but at the moment the tests would be broken. So we deactivate it for now and fix it together with making `failOnEmptyShould` configurable on a per-rule basis. Note that this also showed some tests that were a little shady, i.e. tests that checked for `assertThatMembers(..).matchInAnyOrderMembersOf(..)`, but actually those members were an empty set, at least with certain JDK versions. For members declared in meta-annotated types, this actually also hits the annotation type annotated with the meta-annotation, because meta-annotated counts direct annotations as well. Since the behavior always was like this we adjust the test to match reality in this case. Signed-off-by: Peter Gafert <peter.gafert@tngtech.com> (cherry picked from commit 904587d)
This will allow to override the configuration property `archRule.failOnEmptyShould` on a per-rule basis. We overlooked the use case for certain rules that simply expect to have no match when we introduced `failOnEmptyShould`. An example would be rules like `classes().that(areUnwanted()).should().containNumberOfElements(equalTo(0))`. So making this only configurable on a global level renders it useless for a certain set of users. Also, we broke `optionalLayers` in `LayeredArchitecture` and `OnionArchitecture` with the default configuration, since individual access checks are modelled as rules. `LayeredArchitecture` and `OnionArchitecture` already have the concept of `optionalLayers` which is pretty much the same as expressed by `allowEmptyShould`. We now simply translate `allowEmptyShould` to the existing concept, otherwise the two concepts clash (e.g. declare an `optionalLayer` for which the allowed accesses are internally modelled as separate rule, and it still rejects empty classes if `failOnEmptyShould` is set to `true).` Signed-off-by: Hannes Oberprantacher <h.oberprantacher@gmail.com> Signed-off-by: Peter Gafert <peter.gafert@tngtech.com> (cherry picked from commit 4a3f53e)
This will allow to override the configuration property `archRule.failOnEmptyShould` on a per-rule basis. We overlooked the use case for certain rules that simply expect to have no match when we introduced `failOnEmptyShould`. An example would be rules like `classes().that(areUnwanted()).should().containNumberOfElements(equalTo(0))`. So making this only configurable on a global level renders it useless for a certain set of users. Also, we broke `optionalLayers` in `LayeredArchitecture` and `OnionArchitecture` with the default configuration, since individual access checks are modelled as rules. `LayeredArchitecture` and `OnionArchitecture` already have the concept of `optionalLayers` which is pretty much the same as expressed by `allowEmptyShould`. We now simply translate `allowEmptyShould` to the existing concept, otherwise the two concepts clash (e.g. declare an `optionalLayer` for which the allowed accesses are internally modelled as separate rule, and it still rejects empty classes if `failOnEmptyShould` is set to `true`).
Signed-off-by: codecholeric <action@github.com>
Signed-off-by: codecholeric <action@github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.