未验证 提交 cb276773 编写于 作者: F Feng Wei 提交者: GitHub

Merge pull request #251 from fw8899/master

fix https://github.com/alibaba/p3c/issues/222
......@@ -47,11 +47,14 @@ public class PojoMustOverrideToStringRule extends AbstractPojoRule {
+ "[not(ancestor::Expression/ConditionalAndExpression//EqualityExpression[@Image='!=']//NullLiteral)]"
+ "[not(ancestor::Expression/ConditionalOrExpression//EqualityExpression[@Image='==']//NullLiteral)]";
private static final String LOMBOK_XPATH = "../Annotation/MarkerAnnotation/Name["
private static final String LOMBOK_NAME_XPATH = "/Name["
+ "(@Image='Data' and //ImportDeclaration[@ImportedName='lombok.Data' or @ImportedName='lombok'])"
+ " or (@Image='ToString' and //ImportDeclaration[@ImportedName='lombok.ToString' or @ImportedName='lombok'])"
+ " or (@Image='lombok.Data') or (@Image='lombok.ToString')]";
private static final String LOMBOK_XPATH = "../Annotation/MarkerAnnotation" + LOMBOK_NAME_XPATH
+ "|../Annotation/NormalAnnotation" + LOMBOK_NAME_XPATH;
private static final String MESSAGE_KEY_PREFIX = "java.oop.PojoMustOverrideToStringRule.violation.msg";
@Override
......
......@@ -121,7 +121,7 @@
<code-fragment id="lombok-pojo-4">
<![CDATA[
import lombok.*;
@ToString
@ToString(callSuper = true)
public class FooDO {
private String tom;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册