|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2017 the original author or authors. |
|
|
|
* Copyright 2002-2018 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -19,7 +19,6 @@ package org.springframework.validation; |
|
|
|
import org.springframework.beans.ConfigurablePropertyAccessor; |
|
|
|
import org.springframework.beans.ConfigurablePropertyAccessor; |
|
|
|
import org.springframework.beans.PropertyAccessorFactory; |
|
|
|
import org.springframework.beans.PropertyAccessorFactory; |
|
|
|
import org.springframework.lang.Nullable; |
|
|
|
import org.springframework.lang.Nullable; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Special implementation of the Errors and BindingResult interfaces, |
|
|
|
* Special implementation of the Errors and BindingResult interfaces, |
|
|
|
@ -94,7 +93,9 @@ public class DirectFieldBindingResult extends AbstractPropertyBindingResult { |
|
|
|
* @see #getTarget() |
|
|
|
* @see #getTarget() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected ConfigurablePropertyAccessor createDirectFieldAccessor() { |
|
|
|
protected ConfigurablePropertyAccessor createDirectFieldAccessor() { |
|
|
|
Assert.state(this.target != null, "Cannot access fields on null target instance '" + getObjectName() + "'!"); |
|
|
|
if (this.target == null) { |
|
|
|
|
|
|
|
throw new IllegalStateException("Cannot access fields on null target instance '" + getObjectName() + "'"); |
|
|
|
|
|
|
|
} |
|
|
|
return PropertyAccessorFactory.forDirectFieldAccess(this.target); |
|
|
|
return PropertyAccessorFactory.forDirectFieldAccess(this.target); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|