gpt4 book ai didi

grails - Spock @Unroll 注释

转载 作者:行者123 更新时间:2023-12-02 02:35:57 28 4
gpt4 key购买 nike

在最近的代码审查中,出现了关于 @Unroll 注释属于类级别还是方法级别的问题。该类的大多数方法(但不是全部)都需要 @Unroll。如果在类级别声明并且并非类的所有方法都需要它,声明 @Unroll 是否会导致任何性能损失?

最佳答案

@Unroll 注释旨在用于方法级别。但它也可以在类级别上使用,如 Unroll.java JavaDoc comments 中所示。 :

The {@code Unroll} annotation can also be put on a spec class. This has the same effect as putting it on every data-driven feature method that is not already annotated with {@code Unroll}. By embedding the naming pattern in the method names, each method can still have its own pattern.

关于grails - Spock @Unroll 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30577376/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com