Skip to content

Commit 1295f62

Browse files
committed
Polishing
1 parent b9a2d0a commit 1295f62

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

spring-aop/src/test/java/org/springframework/tests/aop/interceptor/NopInterceptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
3535
return invocation.proceed();
3636
}
3737

38-
public int getCount() {
39-
return this.count;
38+
protected void increment() {
39+
this.count++;
4040
}
4141

42-
protected void increment() {
43-
++count;
42+
public int getCount() {
43+
return this.count;
4444
}
4545

4646

spring-aop/src/test/java/org/springframework/tests/sample/beans/SerializablePerson.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ public class SerializablePerson implements Person, Serializable {
3434

3535

3636
@Override
37-
public int getAge() {
38-
return age;
37+
public String getName() {
38+
return name;
3939
}
4040

4141
@Override
42-
public void setAge(int age) {
43-
this.age = age;
42+
public void setName(String name) {
43+
this.name = name;
4444
}
4545

4646
@Override
47-
public String getName() {
48-
return name;
47+
public int getAge() {
48+
return age;
4949
}
5050

5151
@Override
52-
public void setName(String name) {
53-
this.name = name;
52+
public void setAge(int age) {
53+
this.age = age;
5454
}
5555

5656
@Override
@@ -62,6 +62,7 @@ public Object echo(Object o) throws Throwable {
6262
}
6363

6464

65+
@Override
6566
public boolean equals(Object other) {
6667
if (!(other instanceof SerializablePerson)) {
6768
return false;

spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverterTests.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public void canRead() throws Exception {
8383
public void readXmlRootElementList() throws Exception {
8484
String content = "<list><rootElement><type s=\"1\"/></rootElement><rootElement><type s=\"2\"/></rootElement></list>";
8585
MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8"));
86-
8786
List<RootElement> result = (List<RootElement>) converter.read(rootElementListType, null, inputMessage);
8887

8988
assertEquals("Invalid result", 2, result.size());
@@ -96,7 +95,6 @@ public void readXmlRootElementList() throws Exception {
9695
public void readXmlRootElementSet() throws Exception {
9796
String content = "<set><rootElement><type s=\"1\"/></rootElement><rootElement><type s=\"2\"/></rootElement></set>";
9897
MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8"));
99-
10098
Set<RootElement> result = (Set<RootElement>) converter.read(rootElementSetType, null, inputMessage);
10199

102100
assertEquals("Invalid result", 2, result.size());
@@ -109,7 +107,6 @@ public void readXmlRootElementSet() throws Exception {
109107
public void readXmlTypeList() throws Exception {
110108
String content = "<list><foo s=\"1\"/><bar s=\"2\"/></list>";
111109
MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8"));
112-
113110
List<TestType> result = (List<TestType>) converter.read(typeListType, null, inputMessage);
114111

115112
assertEquals("Invalid result", 2, result.size());
@@ -122,7 +119,6 @@ public void readXmlTypeList() throws Exception {
122119
public void readXmlTypeSet() throws Exception {
123120
String content = "<set><foo s=\"1\"/><bar s=\"2\"/></set>";
124121
MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8"));
125-
126122
Set<TestType> result = (Set<TestType>) converter.read(typeSetType, null, inputMessage);
127123

128124
assertEquals("Invalid result", 2, result.size());
@@ -133,7 +129,6 @@ public void readXmlTypeSet() throws Exception {
133129
@Test
134130
@SuppressWarnings("unchecked")
135131
public void readXmlRootElementExternalEntityDisabled() throws Exception {
136-
137132
Resource external = new ClassPathResource("external.txt", getClass());
138133
String content = "<!DOCTYPE root [" +
139134
" <!ELEMENT external ANY >\n" +
@@ -142,7 +137,6 @@ public void readXmlRootElementExternalEntityDisabled() throws Exception {
142137
MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8"));
143138

144139
converter = new Jaxb2CollectionHttpMessageConverter<Collection<Object>>() {
145-
146140
@Override
147141
protected XMLInputFactory createXmlInputFactory() {
148142
XMLInputFactory inputFactory = super.createXmlInputFactory();
@@ -164,7 +158,6 @@ protected XMLInputFactory createXmlInputFactory() {
164158
@Test
165159
@SuppressWarnings("unchecked")
166160
public void readXmlRootElementExternalEntityEnabled() throws Exception {
167-
168161
Resource external = new ClassPathResource("external.txt", getClass());
169162
String content = "<!DOCTYPE root [" +
170163
" <!ELEMENT external ANY >\n" +
@@ -278,4 +271,4 @@ public int hashCode() {
278271
}
279272
}
280273

281-
}
274+
}

0 commit comments

Comments
 (0)