我有一个由多人开发的 Java Maven 项目。
因为我真的很喜欢做 JUnit 测试之类的,所以 OVal 的概念让我很感兴趣,因为我可以编写如下代码:
@NotNull
@NotEmpty
@Length(max=32)
private String name
不过缺点是:
- 现在每个人都必须将 AspectJ 插件安装到他的 Eclipse
- 至少对我来说,这在每次启动时都会给我一个错误(我可以点击它,但它仍然很烦人)
- 我猜 AspectJ 减慢了一切
那么它是否值得,是否有我不需要 AspectJ 的替代方案?
PS:这是我在 Eclipse 中遇到的错误: 截图 http://img651.imageshack.us/img651/1089/aspectjerror.png
这是 getCommonProperties() 方法的头部,它似乎有问题:
public static LinkedHashMap<String,Integer> getCommonProperties
(
@NotEmpty @NotNull String endpoint,
@NotEmpty @NotNull String where,
@Range(min=0, max=1) Double threshold,
@Min(1) Integer maxResultSize,
@Min(1) Integer sampleSize
)