Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Groovy 3.0.8 #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<m2st.version>2.0</m2st.version>
<m2st-gatc-id>UA-11299971-1</m2st-gatc-id>
<m2st-gatc-config>_setDetectTitle(true)</m2st-gatc-config>
<groovy.version>3.0.8</groovy.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -50,10 +51,20 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-xml</artifactId>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>1.8.8</version>
<version>${groovy.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.ant</groupId>
Expand Down Expand Up @@ -279,6 +290,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<skip>${skip.javadoc}</skip>
</configuration>
<executions>
<execution>
<phase>package</phase>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/groovyx/net/http/EncoderRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.apache.http.entity.StringEntity;
import org.apache.http.message.BasicNameValuePair;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.codehaus.groovy.runtime.IOGroovyMethods;
import org.codehaus.groovy.runtime.MethodClosure;


Expand Down Expand Up @@ -186,7 +187,7 @@ else if ( data instanceof Reader && ! (data instanceof BufferedReader) )
data = new BufferedReader( (Reader)data );
if ( data instanceof BufferedReader ) {
StringWriter out = new StringWriter();
DefaultGroovyMethods.leftShift( out, (BufferedReader)data );
IOGroovyMethods.leftShift( out, (BufferedReader)data );

data = out;
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/groovyx/net/http/HTTPBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HttpContext;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.codehaus.groovy.runtime.IOGroovyMethods;
import org.codehaus.groovy.runtime.MethodClosure;

/** <p>
Expand Down Expand Up @@ -617,12 +618,12 @@ protected Object defaultSuccessHandler( HttpResponseDecorator resp, Object parse
//If response is streaming, buffer it in a byte array:
if ( parsedData instanceof InputStream ) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
DefaultGroovyMethods.leftShift( buffer, (InputStream)parsedData );
IOGroovyMethods.leftShift( buffer, (InputStream)parsedData );
parsedData = new ByteArrayInputStream( buffer.toByteArray() );
}
else if ( parsedData instanceof Reader ) {
StringWriter buffer = new StringWriter();
DefaultGroovyMethods.leftShift( buffer, (Reader)parsedData );
IOGroovyMethods.leftShift( buffer, (Reader)parsedData );
parsedData = new StringReader( buffer.toString() );
}
else if ( parsedData instanceof Closeable )
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/groovyx/net/http/HttpURLClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.apache.http.params.HttpParams;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.codehaus.groovy.runtime.EncodingGroovyMethods;
import org.codehaus.groovy.runtime.IOGroovyMethods;

/**
* <p>This class provides a simplified API similar to {@link HTTPBuilder}, but
Expand Down Expand Up @@ -214,7 +215,7 @@ public HttpResponseDecorator request( Map<String,?> args )
// OAuth Sign if necessary.
if ( oauth != null ) conn = oauth.sign( conn, body );
// send request data
DefaultGroovyMethods.leftShift( conn.getOutputStream(),
IOGroovyMethods.leftShift( conn.getOutputStream(),
body.getContent() );
}
finally { conn.getOutputStream().close(); }
Expand Down Expand Up @@ -259,12 +260,12 @@ private Object getparsedResult( String method, Object contentType, HttpResponse
//If response is streaming, buffer it in a byte array:
if ( parsedData instanceof InputStream ) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
DefaultGroovyMethods.leftShift( buffer, (InputStream)parsedData );
IOGroovyMethods.leftShift( buffer, (InputStream)parsedData );
parsedData = new ByteArrayInputStream( buffer.toByteArray() );
}
else if ( parsedData instanceof Reader ) {
StringWriter buffer = new StringWriter();
DefaultGroovyMethods.leftShift( buffer, (Reader)parsedData );
IOGroovyMethods.leftShift( buffer, (Reader)parsedData );
parsedData = new StringReader( buffer.toString() );
}
else if ( parsedData instanceof Closeable )
Expand Down Expand Up @@ -439,7 +440,7 @@ public boolean isStreaming() {
}

public void writeTo( OutputStream out ) throws IOException {
DefaultGroovyMethods.leftShift( out, conn.getInputStream() );
IOGroovyMethods.leftShift( out, conn.getInputStream() );
}

};
Expand Down