Skip to content

Commit 95a56cd

Browse files
committed
Polishing
1 parent 51cee65 commit 95a56cd

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

spring-context/src/main/java/org/springframework/context/support/DefaultMessageSourceResolvable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
2424
import org.springframework.util.StringUtils;
2525

2626
/**
27-
* Default implementation of the {@link MessageSourceResolvable} interface.
27+
* Spring's default implementation of the {@link MessageSourceResolvable} interface.
2828
* Offers an easy way to store all the necessary values needed to resolve
2929
* a message via a {@link org.springframework.context.MessageSource}.
3030
*
@@ -143,8 +143,8 @@ protected final String resolvableToString() {
143143
}
144144

145145
/**
146-
* Default implementation exposes the attributes of this MessageSourceResolvable.
147-
* To be overridden in more specific subclasses, potentially including the
146+
* The default implementation exposes the attributes of this MessageSourceResolvable.
147+
* <p>To be overridden in more specific subclasses, potentially including the
148148
* resolvable content through {@code resolvableToString()}.
149149
* @see #resolvableToString()
150150
*/

spring-context/src/test/java/org/springframework/validation/beanvalidation/SpringValidatorAdapterTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class SpringValidatorAdapterTests {
7272
@Before
7373
public void setupSpringValidatorAdapter() {
7474
messageSource.addMessage("Size", Locale.ENGLISH, "Size of {0} is must be between {2} and {1}");
75-
messageSource.addMessage("Same", Locale.ENGLISH, "{2} must be same value with {1}");
75+
messageSource.addMessage("Same", Locale.ENGLISH, "{2} must be same value as {1}");
7676
messageSource.addMessage("password", Locale.ENGLISH, "Password");
7777
messageSource.addMessage("confirmPassword", Locale.ENGLISH, "Password(Confirm)");
7878
}
@@ -115,7 +115,7 @@ public void testApplyMessageSourceResolvableToStringArgumentValueWithResolvedLog
115115
assertThat(errors.getFieldValue("password"), is("password"));
116116
FieldError error = errors.getFieldError("password");
117117
assertNotNull(error);
118-
assertThat(messageSource.getMessage(error, Locale.ENGLISH), is("Password must be same value with Password(Confirm)"));
118+
assertThat(messageSource.getMessage(error, Locale.ENGLISH), is("Password must be same value as Password(Confirm)"));
119119
assertTrue(error.contains(ConstraintViolation.class));
120120
assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString(), is("password"));
121121
}
@@ -136,7 +136,7 @@ public void testApplyMessageSourceResolvableToStringArgumentValueWithUnresolvedL
136136
FieldError error2 = errors.getFieldError("confirmEmail");
137137
assertNotNull(error1);
138138
assertNotNull(error2);
139-
assertThat(messageSource.getMessage(error1, Locale.ENGLISH), is("email must be same value with confirmEmail"));
139+
assertThat(messageSource.getMessage(error1, Locale.ENGLISH), is("email must be same value as confirmEmail"));
140140
assertThat(messageSource.getMessage(error2, Locale.ENGLISH), is("Email required"));
141141
assertTrue(error1.contains(ConstraintViolation.class));
142142
assertThat(error1.unwrap(ConstraintViolation.class).getPropertyPath().toString(), is("email"));
@@ -162,7 +162,7 @@ public void testApplyMessageSourceResolvableToStringArgumentValueWithAlwaysUseMe
162162
FieldError error2 = errors.getFieldError("confirmEmail");
163163
assertNotNull(error1);
164164
assertNotNull(error2);
165-
assertThat(messageSource.getMessage(error1, Locale.ENGLISH), is("email must be same value with confirmEmail"));
165+
assertThat(messageSource.getMessage(error1, Locale.ENGLISH), is("email must be same value as confirmEmail"));
166166
assertThat(messageSource.getMessage(error2, Locale.ENGLISH), is("Email required"));
167167
assertTrue(error1.contains(ConstraintViolation.class));
168168
assertThat(error1.unwrap(ConstraintViolation.class).getPropertyPath().toString(), is("email"));
@@ -378,13 +378,13 @@ public static class Child {
378378

379379
private Integer id;
380380

381-
@javax.validation.constraints.NotNull
381+
@NotNull
382382
private String name;
383383

384-
@javax.validation.constraints.NotNull
384+
@NotNull
385385
private Integer age;
386386

387-
@javax.validation.constraints.NotNull
387+
@NotNull
388388
private Parent parent;
389389

390390
public Integer getId() {

spring-context/src/test/java/org/springframework/validation/beanvalidation/ValidatorFactoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ public void setValue(String value) {
429429
@Retention(RetentionPolicy.RUNTIME)
430430
@Target(ElementType.FIELD)
431431
@Constraint(validatedBy=InnerValidator.class)
432-
public static @interface InnerValid {
432+
public @interface InnerValid {
433433

434434
String message() default "NOT VALID";
435435

spring-expression/src/main/java/org/springframework/expression/spel/ast/OpEQ.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,8 +43,7 @@ public BooleanTypedValue getValueInternal(ExpressionState state) throws Evaluati
4343
Object right = getRightOperand().getValueInternal(state).getValue();
4444
this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left);
4545
this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right);
46-
return BooleanTypedValue.forValue(
47-
equalityCheck(state.getEvaluationContext(), left, right));
46+
return BooleanTypedValue.forValue(equalityCheck(state.getEvaluationContext(), left, right));
4847
}
4948

5049
// This check is different to the one in the other numeric operators (OpLt/etc)

0 commit comments

Comments
 (0)