> +public class DescriptionValidator extends Validator<String> {
> +
> +   private static final int MAX_DESC_LENGTH = 1024;
> +
> +   @Override
> +   public void validate(String description) {
> +      if (isNullOrEmpty(description))
> +         return;
> +      if (description.length() > MAX_DESC_LENGTH)
> +         throw exception("Description can't be longer than " + 
> MAX_DESC_LENGTH + " characters" + " but was " + description.length());
> +      CharMatcher range = getDescriptionAcceptableRange();
> +      if (!range.matchesAllOf(description))
> +         throw exception("Description should have ASCII values between 32 
> and 126.");
> +   }
> +
> +   private static CharMatcher getDescriptionAcceptableRange() {

Can you make the `CharMatcher` a static final variable?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/13/files#r13886605

Reply via email to