File tree 2 files changed +4
-7
lines changed
spring-test/src/main/java/org/springframework/mock/http
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2017 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.
@@ -38,7 +38,7 @@ public class MockHttpInputMessage implements HttpInputMessage {
38
38
39
39
40
40
public MockHttpInputMessage (byte [] contents ) {
41
- this .body = (contents != null ? new ByteArrayInputStream ( contents ) : null );
41
+ this .body = new ByteArrayInputStream (contents != null ? contents : new byte [ 0 ] );
42
42
}
43
43
44
44
public MockHttpInputMessage (InputStream body ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2017 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.
@@ -72,10 +72,7 @@ public String getStatusText() throws IOException {
72
72
@ Override
73
73
public void close () {
74
74
try {
75
- InputStream body = getBody ();
76
- if (body != null ) {
77
- body .close ();
78
- }
75
+ getBody ().close ();
79
76
}
80
77
catch (IOException ex ) {
81
78
// ignore
You can’t perform that action at this time.
0 commit comments