diff --git a/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java b/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java index b85e176c7a..2ee871d91f 100644 --- a/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java +++ b/spring-context/src/main/java/org/springframework/validation/AbstractErrors.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -209,6 +209,9 @@ public abstract class AbstractErrors implements Errors, Serializable { if (field.equals(fieldError.getField())) { return true; } + if (field.equals("")) { + return false; + } // Optimization: use charAt instead of endsWith (SPR-11304) int endIndex = field.length() - 1; return (field.charAt(endIndex) == '*' && fieldError.getField().startsWith(field.substring(0, endIndex)));