Author: rjung Date: Tue Dec 16 11:40:13 2014 New Revision: 1645926 URL: http://svn.apache.org/r1645926 Log: Fix r1645628: - Remove merge markers - Replace <> notation - Replace try-with-resources
Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1645926&r1=1645925&r2=1645926&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original) +++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Tue Dec 16 11:40:13 2014 @@ -195,8 +195,6 @@ public abstract class TomcatBaseTest ext /** -<<<<<<< .working -======= * Simple servlet that dumps request information. Tests using this should * note that additional information may be added to in the future and should * therefore test return values accordingly. @@ -235,19 +233,38 @@ public abstract class TomcatBaseTest ext // reading any of the response. They may cause this test to lock up. byte[] buffer = new byte[8096]; int read = 0; - try (InputStream is = req.getInputStream(); - OutputStream os = resp.getOutputStream()) { + InputStream is = null; + OutputStream os = null; + try { + is = req.getInputStream(); + os = resp.getOutputStream(); while (read > -1) { os.write(buffer, 0, read); read = is.read(buffer); } + } catch (IOException ex) { + // Ignore + } finally { + if (os != null) { + try { + os.close(); + } catch (IOException e) { + // Ignore + } + } + if (is != null) { + try { + is.close(); + } catch (IOException e) { + // Ignore + } + } } } } /* ->>>>>>> .merge-right.r1645627 * Wrapper for getting the response. */ public static ByteChunk getUrl(String path) throws IOException { Modified: tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java?rev=1645926&r1=1645925&r2=1645926&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java (original) +++ tomcat/tc7.0.x/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java Tue Dec 16 11:40:13 2014 @@ -630,13 +630,13 @@ public class TestAbstractHttp11Processor byte[] requestBody = "HelloWorld".getBytes("UTF-8"); Map<String,List<String>> reqHeaders = null; if (useExpectation) { - reqHeaders = new HashMap<>(); - List<String> expectation = new ArrayList<>(); + reqHeaders = new HashMap<String,List<String>>(); + List<String> expectation = new ArrayList<String>(); expectation.add("100-continue"); reqHeaders.put("Expect", expectation); } ByteChunk responseBody = new ByteChunk(); - Map<String,List<String>> responseHeaders = new HashMap<>(); + Map<String,List<String>> responseHeaders = new HashMap<String,List<String>>(); int rc = postUrl(requestBody, "http://localhost:" + getPort() + "/echo", responseBody, reqHeaders, responseHeaders); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org