Skip to content

Commit

Permalink
Merge pull request alibaba#251 from fw8899/master
Browse files Browse the repository at this point in the history
  • Loading branch information
fw8899 authored Feb 1, 2018
2 parents 598d172 + 10f3848 commit cb27677
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<code-fragment id="lombok-pojo-4">
<![CDATA[
import lombok.*;
@ToString
@ToString(callSuper = true)
public class FooDO {
private String tom;
}
Expand Down

0 comments on commit cb27677

Please sign in to comment.