Conversation
Add support for casts TNG#710 Signed-off-by: Kaammill <>
hankem
left a comment
There was a problem hiding this comment.
Thanks for your contribution! I've only had a very quick first look so far, but it will be easier to review whether the feature works as intended once you've added the according tests.
| import com.tngtech.archunit.base.HasDescription; | ||
| import com.tngtech.archunit.base.Optional; | ||
| import com.tngtech.archunit.core.domain.AccessTarget; | ||
| import com.tngtech.archunit.core.domain.*; |
There was a problem hiding this comment.
We don't use * imports, see https://github.com/TNG/ArchUnit/blob/main/CONTRIBUTING.md#formatting.
There was a problem hiding this comment.
sorry for it, did not set intellij auto format,
| private TypeCast(JavaCodeUnit owner, JavaClass value, int lineNumber) { | ||
| this.owner = checkNotNull(owner); | ||
| this.value = checkNotNull(value); | ||
| this.lineNumber = lineNumber; |
There was a problem hiding this comment.
We don't have to store the lineNumber redundantly, but can always use sourceCodeLocation.getLineNumber().
| } | ||
|
|
||
| @PublicAPI(usage = ACCESS) | ||
| public Set<TypeCast> getypeCast() { |
There was a problem hiding this comment.
Maybe getTypeCasts? (And same in JavaMembers.)
There was a problem hiding this comment.
ok, so the idea is to move typeCast inside JavaMembers class? or just call getTypeCasts inside it like for example getReferencedClassObjects method?
There was a problem hiding this comment.
This method is currently called getypeCast. As it returns a Set of TypeCast objects, I thought that a pluralized name getTypeCasts might be more appropriate.
The delegation to JavaMembers is probably fine, but I'd also rename the method there.
|
@Kaammill We have formatters for IntelliJ and Eclipse checked in here. That would automatically do the imports and other style consistently then 🙂 (also compare CONTRIBUTING where this an other things are explained. In particular also the DCO check -> you can see that this at the moment fails for your PR) |
|
May I ask what the state of this PR is? 🙂 |
|
@Kaammill @codecholeric |
Add support for casts #710
It is my first commit therefore all feedback is more then welcome