Skip to content

Commit

Permalink
Improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiaofeng committed Jan 24, 2025
1 parent 45164c4 commit 83ca1ac
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class ErrorParserPolicy implements Cloneable {
*/
private Set<String> contentTypes;

private transient Boolean valid;

public ErrorParserPolicy() {
}

Expand Down Expand Up @@ -93,7 +95,10 @@ public ErrorParserPolicy clone() {
}

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

public void cache() {
Expand Down

0 comments on commit 83ca1ac

Please sign in to comment.