[groovy] branch master updated: GROOVY-9819: bump jsp-api/servlet-api versions to 2.3.3/4.0.1 (closes #1421)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch master updated: GROOVY-9819: bump jsp-api/servlet-api versions to 2.3.3/4.0.1 (closes #1421)

paulk
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new c0ac40e  GROOVY-9819: bump jsp-api/servlet-api versions to 2.3.3/4.0.1 (closes #1421)
c0ac40e is described below

commit c0ac40eb2ea00c906bfe6de1d1c559fe825abbad
Author: Paul King <[hidden email]>
AuthorDate: Tue Nov 17 20:49:11 2020 +1000

    GROOVY-9819: bump jsp-api/servlet-api versions to 2.3.3/4.0.1 (closes #1421)
---
 gradle/verification-metadata.xml                   | 24 ++--------------------
 subprojects/groovy-servlet/build.gradle            |  8 ++++----
 .../main/java/groovy/servlet/ServletBinding.java   | 21 ++++++++++++++++++-
 .../groovy/servlet/ServletBindingTest.groovy       |  8 ++++++++
 versions.properties                                |  2 ++
 5 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml
index 088adde..4495bf4 100644
--- a/gradle/verification-metadata.xml
+++ b/gradle/verification-metadata.xml
@@ -88,9 +88,9 @@
             <trusting group="org.slf4j"/>
             <trusting group="ch.qos.logback"/>
          </trusted-key>
-         <trusted-key id="4daded739cdf2cd0e48e0ec44044edf1bb73efea" group="jaxen" name="jaxen" version="1.1.6"/>
+         <trusted-key id="4daded739cdf2cd0e48e0ec44044edf1bb73efea" group="jaxen" name="jaxen"/>
          <trusted-key id="4db1a49729b053caf015cee9a6adfc93ef34893e" group="org.hamcrest"/>
-         <trusted-key id="4f7e32d440ef90a83011a8fc6425559c47cc79c4" group="javax.servlet" name="javax.servlet-api" version="3.0.1"/>
+         <trusted-key id="4f7e32d440ef90a83011a8fc6425559c47cc79c4" group="^javax[.]servlet($|([.].*))" regex="true"/>
          <trusted-key id="517b94f8d0a46317a28d8ab30da8a5ec02d11ead" group="net.sf.jopt-simple" name="jopt-simple" version="4.6"/>
          <trusted-key id="53c935821aa6a755bd337db53595395eb3d8e1ba" group="org.apache.logging.log4j"/>
          <trusted-key id="6214760097dc5cfad0175ac2c9fbaa83a8753994">
@@ -292,11 +292,6 @@
             <pgp value="8756c4f765c9ac3cb6b85d62379ce192d401ab61"/>
          </artifact>
       </component>
-      <component group="com.github.javaparser" name="javaparser-core" version="3.16.2">
-         <artifact name="javaparser-core-3.16.2.jar">
-            <pgp value="8756c4f765c9ac3cb6b85d62379ce192d401ab61"/>
-         </artifact>
-      </component>
       <component group="com.github.javaparser" name="javaparser-core" version="3.16.3">
          <artifact name="javaparser-core-3.16.3.jar">
             <pgp value="8756c4f765c9ac3cb6b85d62379ce192d401ab61"/>
@@ -497,11 +492,6 @@
             <pgp value="b38e195d438d44a1a8d2d2203575e1c767076ca8"/>
          </artifact>
       </component>
-      <component group="jaxen" name="jaxen" version="1.1.6">
-         <artifact name="jaxen-1.1.6.jar">
-            <pgp value="4daded739cdf2cd0e48e0ec44044edf1bb73efea"/>
-         </artifact>
-      </component>
       <component group="jaxen" name="jaxen" version="1.2.0">
          <artifact name="jaxen-1.2.0.jar">
             <pgp value="ca491704d613780d2bee00f2c6fc46eb51cf569c"/>
@@ -532,11 +522,6 @@
             <sha512 value="8e6f9fa5eb3ba93a8b1b5a39e01a81c142b33078264dbd0a2030d60dd26735407249a12e66f5cdcab8056e93a5687124fe66e741c233b4c7a06cc8e49f82e98b" origin="Generated by Gradle because artifact wasn't signed"/>
          </artifact>
       </component>
-      <component group="junit" name="junit" version="4.13">
-         <artifact name="junit-4.13.jar">
-            <pgp value="ff6e2c001948c5f2f38b0cc385911f425ec61b51"/>
-         </artifact>
-      </component>
       <component group="junit" name="junit" version="4.13.1">
          <artifact name="junit-4.13.1.jar">
             <pgp value="ff6e2c001948c5f2f38b0cc385911f425ec61b51"/>
@@ -572,11 +557,6 @@
             <sha512 value="b7d29d19f5955ac0909b387bab7fe3fc7af92bc7c952d29f7fd5b57ad33a7c96344b8d625b76836d1840706ebbc4e5872a02894ecb31ede4a73bf398d8d88f43" origin="Generated by Gradle because artifact wasn't signed"/>
          </artifact>
       </component>
-      <component group="net.bytebuddy" name="byte-buddy" version="1.10.10">
-         <artifact name="byte-buddy-1.10.10.jar">
-            <pgp value="a7892505cf1a58076453e52d7999befba1039e8b"/>
-         </artifact>
-      </component>
       <component group="net.bytebuddy" name="byte-buddy" version="1.10.16">
          <artifact name="byte-buddy-1.10.16.jar">
             <pgp value="a7892505cf1a58076453e52d7999befba1039e8b"/>
diff --git a/subprojects/groovy-servlet/build.gradle b/subprojects/groovy-servlet/build.gradle
index 5225d48..b99aa22 100644
--- a/subprojects/groovy-servlet/build.gradle
+++ b/subprojects/groovy-servlet/build.gradle
@@ -21,8 +21,8 @@ plugins {
 }
 
 dependencies {
-    compileOnlyApi('javax.servlet:javax.servlet-api:3.0.1')
-    compileOnlyApi('javax.servlet:jsp-api:2.0') {
+    compileOnlyApi("javax.servlet:javax.servlet-api:${versions.javaxServletApi}")
+    compileOnlyApi("javax.servlet.jsp:javax.servlet.jsp-api:${versions.javaxJspApi}") {
         exclude(group: 'javax.servlet', module: 'servlet-api')
     }
 
@@ -30,8 +30,8 @@ dependencies {
     implementation project(':groovy-xml') // needed for MarkupBuilder
     implementation project(':groovy-templates') // needed by TemplateServlet
 
-    testImplementation('javax.servlet:javax.servlet-api:3.0.1')
-    testImplementation('javax.servlet:jsp-api:2.0') {
+    testImplementation("javax.servlet:javax.servlet-api:${versions.javaxServletApi}")
+    testImplementation("javax.servlet.jsp:javax.servlet.jsp-api:${versions.javaxJspApi}") {
         exclude(group: 'javax.servlet', module: 'servlet-api')
     }
     testImplementation "jmock:jmock:${versions.jmock}"
diff --git a/subprojects/groovy-servlet/src/main/java/groovy/servlet/ServletBinding.java b/subprojects/groovy-servlet/src/main/java/groovy/servlet/ServletBinding.java
index 842e60c..2bf2498 100644
--- a/subprojects/groovy-servlet/src/main/java/groovy/servlet/ServletBinding.java
+++ b/subprojects/groovy-servlet/src/main/java/groovy/servlet/ServletBinding.java
@@ -27,6 +27,7 @@ import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.ByteArrayOutputStream;
@@ -133,8 +134,26 @@ public class ServletBinding extends Binding {
         public ServletOutputStream getOutputStream() {
             return new ServletOutputStream() {
                 @Override
+                public boolean isReady() {
+                    try {
+                        return getResponseStream().isReady();
+                    } catch (IOException e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+
+                @Override
+                public void setWriteListener(WriteListener writeListener) {
+                    try {
+                        getResponseStream().setWriteListener(writeListener);
+                    } catch (IOException e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+
+                @Override
                 public void write(int b) throws IOException {
-                    getResponseStream().write(b);                    
+                    getResponseStream().write(b);
                 }
                 @Override
                 public void close() throws IOException {
diff --git a/subprojects/groovy-servlet/src/test/groovy/groovy/servlet/ServletBindingTest.groovy b/subprojects/groovy-servlet/src/test/groovy/groovy/servlet/ServletBindingTest.groovy
index 079c7cc..c8becfc 100644
--- a/subprojects/groovy-servlet/src/test/groovy/groovy/servlet/ServletBindingTest.groovy
+++ b/subprojects/groovy-servlet/src/test/groovy/groovy/servlet/ServletBindingTest.groovy
@@ -23,6 +23,7 @@ import groovy.xml.MarkupBuilder
 
 import javax.servlet.ServletContext
 import javax.servlet.ServletOutputStream
+import javax.servlet.WriteListener
 import javax.servlet.http.HttpServletRequest
 import javax.servlet.http.HttpServletResponse
 import javax.servlet.http.HttpSession
@@ -257,5 +258,12 @@ class ServletBindingTest extends GroovyTestCase {
  * Test specific sub class to stub out the ServletOutputStream class.
  */
 class OutputStreamStub extends ServletOutputStream {
+    @Override
     void write(int x) { }
+
+    @Override
+    boolean isReady() { return false }
+
+    @Override
+    void setWriteListener(WriteListener writeListener) {}
 }
diff --git a/versions.properties b/versions.properties
index 33608d6..5bf0af3 100644
--- a/versions.properties
+++ b/versions.properties
@@ -53,3 +53,5 @@ junit5 = 5.7.0
 junit5Platform = 1.7.0
 jcipAnnotations = 1.0
 treelayout = 1.0.3
+javaxServletApi = 4.0.1
+javaxJspApi = 2.3.3