File tree 2 files changed +8
-6
lines changed
spring-context/src/main/java/org/springframework/validation
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
21
21
import org .springframework .beans .BeanWrapper ;
22
22
import org .springframework .beans .ConfigurablePropertyAccessor ;
23
23
import org .springframework .beans .PropertyAccessorFactory ;
24
- import org .springframework .util .Assert ;
25
24
26
25
/**
27
26
* Default implementation of the {@link Errors} and {@link BindingResult}
@@ -102,7 +101,9 @@ public final ConfigurablePropertyAccessor getPropertyAccessor() {
102
101
* @see #getTarget()
103
102
*/
104
103
protected BeanWrapper createBeanWrapper () {
105
- Assert .state (this .target != null , "Cannot access properties on null bean instance '" + getObjectName () + "'!" );
104
+ if (this .target == null ) {
105
+ throw new IllegalStateException ("Cannot access properties on null bean instance '" + getObjectName () + "'" );
106
+ }
106
107
return PropertyAccessorFactory .forBeanPropertyAccess (this .target );
107
108
}
108
109
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
18
18
19
19
import org .springframework .beans .ConfigurablePropertyAccessor ;
20
20
import org .springframework .beans .PropertyAccessorFactory ;
21
- import org .springframework .util .Assert ;
22
21
23
22
/**
24
23
* Special implementation of the Errors and BindingResult interfaces,
@@ -90,7 +89,9 @@ public final ConfigurablePropertyAccessor getPropertyAccessor() {
90
89
* @see #getTarget()
91
90
*/
92
91
protected ConfigurablePropertyAccessor createDirectFieldAccessor () {
93
- Assert .state (this .target != null , "Cannot access fields on null target instance '" + getObjectName () + "'!" );
92
+ if (this .target == null ) {
93
+ throw new IllegalStateException ("Cannot access fields on null target instance '" + getObjectName () + "'" );
94
+ }
94
95
return PropertyAccessorFactory .forDirectFieldAccess (this .target );
95
96
}
96
97
You can’t perform that action at this time.
0 commit comments