Skip to content

Commit

Permalink
Fix isValid
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiaofeng committed Jan 24, 2025
1 parent a2c3800 commit fb10eaf
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public class ErrorParserPolicy implements Cloneable {
@Setter
private Set<String> contentTypes;

private transient boolean valid;

public ErrorParserPolicy() {
}

Expand Down Expand Up @@ -97,12 +95,15 @@ public ErrorParserPolicy clone() {
}
}

public boolean isValid() {
return parser != null && expression != null && !parser.isEmpty() && !expression.isEmpty();
}

public void cache() {
if (contentTypes != null) {
Set<String> lowerCases = new HashSet<>(contentTypes);
contentTypes.forEach(o -> lowerCases.add(o.toLowerCase()));
contentTypes = lowerCases;
}
valid = parser != null && expression != null && !parser.isEmpty() && !expression.isEmpty();
}
}

0 comments on commit fb10eaf

Please sign in to comment.