Started by timer Running as SYSTEM [EnvInject] - Loading node environment variables. Building remotely on sos-builder01-ubuntu18 (lin) in workspace /builds/workspace/Mimecraft [WS-CLEANUP] Deleting project workspace... [WS-CLEANUP] Deferred wipeout is used... [WS-CLEANUP] Done The recommended git tool is: NONE No credentials specified Cloning the remote Git repository Cloning repository https://github.com/square/mimecraft.git > git init /builds/workspace/Mimecraft # timeout=10 Fetching upstream changes from https://github.com/square/mimecraft.git > git --version # timeout=10 > git --version # 'git version 2.17.1' > git fetch --tags --progress -- https://github.com/square/mimecraft.git +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config remote.origin.url https://github.com/square/mimecraft.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 Avoid second fetch > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 Checking out Revision 88f689c73972dde450961714ec4766378c777ad0 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 88f689c73972dde450961714ec4766378c777ad0 # timeout=10 Commit message: "Mark MimeCraft as deprecated." > git rev-list --no-walk 88f689c73972dde450961714ec4766378c777ad0 # timeout=10 [Mimecraft] $ /bin/sh -xe /tmp/jenkins3091411807577956405.sh + stdbuf -i 50k bash + curl https://spoon.gforge.inria.fr/jenkins/build.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 ------------------------------------------------------- Initizalizes project ------------------------------------------------------- 100 21998 100 21998 0 0 116k 0 --:--:-- --:--:-- --:--:-- 116k HEAD is now at 88f689c Mark MimeCraft as deprecated. --- Displays variables used in the build --- Artifact id: mimecraft Version: 1.1.2-SNAPSHOT Modules job: - Mimecraft Has checkstyle: true Has enforcer: true Git version id: 88f689c73972dde450961714ec4766378c777ad0 Java version: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 openjdk version "11.0.15" 2022-04-19 OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.18.04.1) OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.18.04.1, mixed mode, sharing) Java home: /usr/lib/jvm/java-11-openjdk-amd64 ------------------------------------------------------- Compiles project (at the root project if it's a multi module project) without spoon ------------------------------------------------------- Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 [INFO] Scanning for projects... [INFO] [INFO] ------------------< com.squareup.mimecraft:mimecraft >------------------ [INFO] Building Mime Craft 1.1.2-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mimecraft --- [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ mimecraft --- [INFO] Skipping Rule Enforcement. [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mimecraft --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /builds/workspace/Mimecraft/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ mimecraft --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 4 source files to /builds/workspace/Mimecraft/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mimecraft --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /builds/workspace/Mimecraft/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ mimecraft --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 6 source files to /builds/workspace/Mimecraft/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mimecraft --- [INFO] Surefire report directory: /builds/workspace/Mimecraft/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 Running com.squareup.mimecraft.PartTest Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.173 sec Running com.squareup.mimecraft.ComplexExamplesTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec Running com.squareup.mimecraft.FormWriterTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Running com.squareup.mimecraft.MultipartWriterTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec Results : Tests run: 14, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mimecraft --- [INFO] Building jar: /builds/workspace/Mimecraft/target/mimecraft-1.1.2-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mimecraft --- [INFO] Installing /builds/workspace/Mimecraft/target/mimecraft-1.1.2-SNAPSHOT.jar to /builds/.m2/repository/com/squareup/mimecraft/mimecraft/1.1.2-SNAPSHOT/mimecraft-1.1.2-SNAPSHOT.jar [INFO] Installing /builds/workspace/Mimecraft/pom.xml to /builds/.m2/repository/com/squareup/mimecraft/mimecraft/1.1.2-SNAPSHOT/mimecraft-1.1.2-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.861 s [INFO] Finished at: 2023-11-18T15:09:09+01:00 [INFO] ------------------------------------------------------------------------ --- Displays results of the maven compile --- Time to compile: 8251 Number of tests: 14 Number of tests skipped: 0 Number of failures in tests: 0 Number of errors in tests: 0 ------------------------------------------------------- Inserts the maven plugin to spoon the project ------------------------------------------------------- Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 [INFO] Scanning for projects... [INFO] [INFO] ------------------< com.squareup.mimecraft:mimecraft >------------------ [INFO] Building Mime Craft 1.1.2-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- versions-maven-plugin:2.16.2:resolve-ranges (default-cli) @ mimecraft --- Downloading from central: https://repo.maven.apache.org/maven2/org/easytesting/fest-assert-core/maven-metadata.xml Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/easytesting/fest-assert-core/maven-metadata.xml Progress (1): 620 B Downloaded from central: https://repo.maven.apache.org/maven2/org/easytesting/fest-assert-core/maven-metadata.xml (620 B at 801 B/s) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.128 s [INFO] Finished at: 2023-11-18T15:09:16+01:00 [INFO] ------------------------------------------------------------------------ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 [INFO] Scanning for projects... [INFO] [INFO] ------------------< com.squareup.mimecraft:mimecraft >------------------ [INFO] Building Mime Craft 1.1.2-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-dependency-plugin:2.8:purge-local-repository (default-cli) @ mimecraft --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.090 s [INFO] Finished at: 2023-11-18T15:09:20+01:00 [INFO] ------------------------------------------------------------------------ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 [INFO] Scanning for projects... [INFO] [INFO] ------------------< com.squareup.mimecraft:mimecraft >------------------ [INFO] Building Mime Craft 1.1.2-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mimecraft --- [INFO] Deleting /builds/workspace/Mimecraft/target [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ mimecraft --- [INFO] Skipping Rule Enforcement. [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mimecraft --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /builds/workspace/Mimecraft/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ mimecraft --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 4 source files to /builds/workspace/Mimecraft/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mimecraft --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /builds/workspace/Mimecraft/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ mimecraft --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 6 source files to /builds/workspace/Mimecraft/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mimecraft --- [INFO] Tests are skipped. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.035 s [INFO] Finished at: 2023-11-18T15:09:27+01:00 [INFO] ------------------------------------------------------------------------ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 [INFO] Scanning for projects... [INFO] [INFO] ------------------< com.squareup.mimecraft:mimecraft >------------------ [INFO] Building Mime Craft 1.1.2-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- spoon-maven-plugin:3.8-SNAPSHOT:generate (default-cli) @ mimecraft --- Downloading from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/maven-metadata.xml Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/maven-metadata.xml Progress (1): 1.4 kB Progress (2): 1.4 kB | 1.4 kB Downloaded from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/maven-metadata.xml (1.4 kB at 1.4 kB/s) Downloaded from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/maven-metadata.xml (1.4 kB at 1.4 kB/s) Downloading from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/spoon-core-10.4.3-20231118.005933-1.pom Progress (1): 4.1/8.5 kB Progress (1): 7.8/8.5 kB Progress (1): 8.5 kB Downloaded from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/spoon-core-10.4.3-20231118.005933-1.pom (8.5 kB at 14 kB/s) Downloading from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-pom/10.4.3-SNAPSHOT/maven-metadata.xml Progress (1): 609 B Downloaded from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-pom/10.4.3-SNAPSHOT/maven-metadata.xml (609 B at 1.7 kB/s) Downloading from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-pom/10.4.3-SNAPSHOT/spoon-pom-10.4.3-20231118.010617-1.pom Downloaded from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-pom/10.4.3-SNAPSHOT/spoon-pom-10.4.3-20231118.010617-1.pom (0 B at 0 B/s) Downloading from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/spoon-core-10.4.3-20231118.005933-1.jar Progress (1): 0/1.9 MB Progress (1): 0/1.9 MB Progress (1): 0/1.9 MB Progress (1): 0/1.9 MB Progress (1): 0/1.9 MB Progress (1): 0/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.1/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.2/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.3/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.4/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.5/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.6/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.7/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.8/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 0.9/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.0/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.1/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.2/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.3/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.4/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.5/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.6/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.7/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.8/1.9 MB Progress (1): 1.9/1.9 MB Progress (1): 1.9/1.9 MB Progress (1): 1.9/1.9 MB Progress (1): 1.9/1.9 MB Progress (1): 1.9 MB Downloaded from ow2.org-snapshot: https://oss.sonatype.org/content/repositories/snapshots/fr/inria/gforge/spoon/spoon-core/10.4.3-SNAPSHOT/spoon-core-10.4.3-20231118.005933-1.jar (1.9 MB at 1.0 MB/s) [INFO] Running Spoon... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.735 s [INFO] Finished at: 2023-11-18T15:09:39+01:00 [INFO] ------------------------------------------------------------------------ normal maven case diff --git a/src/main/java/com/squareup/mimecraft/FormEncoding.java b/src/main/java/com/squareup/mimecraft/FormEncoding.java index 12b749f..11830ef 100644 --- a/src/main/java/com/squareup/mimecraft/FormEncoding.java +++ b/src/main/java/com/squareup/mimecraft/FormEncoding.java @@ -1,64 +1,60 @@ -// Copyright 2013 Square, Inc. package com.squareup.mimecraft; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.Collections; -import java.util.Map; - /** * <a href="http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1">HTML 2.0</a>-compliant * form data. */ -public final class FormEncoding implements Part { - private static final Map<String, String> HEADERS = - Collections.singletonMap("Content-Type", "application/x-www-form-urlencoded"); +public final class FormEncoding implements com.squareup.mimecraft.Part { + private static final java.util.Map<java.lang.String, java.lang.String> HEADERS = java.util.Collections.singletonMap("Content-Type", "application/x-www-form-urlencoded"); + + /** + * Fluent API to build {@link FormEncoding} instances. + */ + public static class Builder { + private final java.lang.StringBuilder content = new java.lang.StringBuilder(); + + /** + * Add new key-value pair. + */ + public com.squareup.mimecraft.FormEncoding.Builder add(java.lang.String name, java.lang.String value) { + if (content.length() > 0) { + content.append('&'); + } + try { + content.append(java.net.URLEncoder.encode(name, "UTF-8")).append('=').append(java.net.URLEncoder.encode(value, "UTF-8")); + } catch (java.io.UnsupportedEncodingException e) { + throw new java.lang.AssertionError(e); + } + return this; + } + + /** + * Create {@link FormEncoding} instance. + */ + public com.squareup.mimecraft.FormEncoding build() { + if (content.length() == 0) { + throw new java.lang.IllegalStateException("Form encoded body must have at least one part."); + } + return new com.squareup.mimecraft.FormEncoding(content.toString()); + } + } - /** Fluent API to build {@link FormEncoding} instances. */ - public static class Builder { - private final StringBuilder content = new StringBuilder(); + private final byte[] data; - /** Add new key-value pair. */ - public Builder add(String name, String value) { - if (content.length() > 0) { - content.append('&'); - } - try { - content.append(URLEncoder.encode(name, "UTF-8")) - .append('=') - .append(URLEncoder.encode(value, "UTF-8")); - } catch (UnsupportedEncodingException e) { - throw new AssertionError(e); - } - return this; + private FormEncoding(java.lang.String data) { + try { + this.data = data.getBytes("UTF-8"); + } catch (java.io.UnsupportedEncodingException e) { + throw new java.lang.IllegalArgumentException("Unable to convert input to UTF-8: " + data, e); + } } - /** Create {@link FormEncoding} instance. */ - public FormEncoding build() { - if (content.length() == 0) { - throw new IllegalStateException("Form encoded body must have at least one part."); - } - return new FormEncoding(content.toString()); + @java.lang.Override + public java.util.Map<java.lang.String, java.lang.String> getHeaders() { + return com.squareup.mimecraft.FormEncoding.HEADERS; } - } - private final byte[] data; - - private FormEncoding(String data) { - try { - this.data = data.getBytes("UTF-8"); Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 [INFO] Scanning for projects... [INFO] [INFO] ------------------< com.squareup.mimecraft:mimecraft >------------------ [INFO] Building Mime Craft 1.1.2-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mimecraft --- [INFO] Deleting /builds/workspace/Mimecraft/target [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ mimecraft --- [INFO] Skipping Rule Enforcement. [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mimecraft --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /builds/workspace/Mimecraft/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ mimecraft --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 5 source files to /builds/workspace/Mimecraft/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mimecraft --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /builds/workspace/Mimecraft/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ mimecraft --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 6 source files to /builds/workspace/Mimecraft/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mimecraft --- [INFO] Surefire report directory: /builds/workspace/Mimecraft/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 Running com.squareup.mimecraft.PartTest Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.208 sec Running com.squareup.mimecraft.ComplexExamplesTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec Running com.squareup.mimecraft.FormWriterTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec Running com.squareup.mimecraft.MultipartWriterTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec Results : Tests run: 14, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mimecraft --- [INFO] Building jar: /builds/workspace/Mimecraft/target/mimecraft-1.1.2-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mimecraft --- [INFO] Installing /builds/workspace/Mimecraft/target/mimecraft-1.1.2-SNAPSHOT.jar to /builds/.m2/repository/com/squareup/mimecraft/mimecraft/1.1.2-SNAPSHOT/mimecraft-1.1.2-SNAPSHOT.jar [INFO] Installing /builds/workspace/Mimecraft/pom.xml to /builds/.m2/repository/com/squareup/mimecraft/mimecraft/1.1.2-SNAPSHOT/mimecraft-1.1.2-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.203 s [INFO] Finished at: 2023-11-18T15:09:48+01:00 [INFO] ------------------------------------------------------------------------ --- Displays results of the maven compile with spoon of spoon --- Time to compile with spoon of spoon: 8690 --- Displays results of the maven compile with spoon --- Time to compile with spoon: 6377 Number of tests: 14 Number of tests skipped: 0 Number of failures in tests: 0 Number of errors in tests: 0 ------------------------------------------------------- Retrieves all results files in the project (in all sub modules if the project is a multi module project) ------------------------------------------------------- ./result-spoon-tests-spooned-..txt ./result-spoon-tests-..txt find: './target/spoon-maven-plugin': No such file or directory rm: cannot remove 'result-spoon.bak*.xml': No such file or directory <?xml version="1.0"?> <section name=""> <table> <tr> <td fontattribute="bold">Project</td> <td fontattribute="bold">Commit id version</td> <td fontattribute="bold">Project compiles</td> <td fontattribute="bold">Project tests run</td> <td fontattribute="bold">Project spooned compiles</td> <td fontattribute="bold">Project spooned tests run</td> <td fontattribute="bold">Time to spoon</td> <td fontattribute="bold">Number of CtStatment</td> <td fontattribute="bold">Time to compile project</td> <td fontattribute="bold">Time to compile project spooned</td> <td fontattribute="bold">Spoon(Spoon(x))=Spoon(x)</td> </tr> </table> </section> Archiving artifacts Finished: SUCCESS