Skip to content

Commit

Permalink
Revert "feat(QTDI-113): Support Java 17 compilation (#936)"
Browse files Browse the repository at this point in the history
This reverts commit b0cc8e8.
  • Loading branch information
undx committed Jan 15, 2025
1 parent 9317bdd commit 0d93fc5
Show file tree
Hide file tree
Showing 36 changed files with 228 additions and 207 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
java adoptopenjdk-17.0.5+8
maven 3.9.9
maven 3.8.8
trivy 0.54.1
17 changes: 6 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ pipeline {
description: 'Force documentation stage for development branches. No effect on master and maintenance.')

string(name: 'JAVA_VERSION',
defaultValue: 'from .tool-versions',
defaultValue: 'adoptopenjdk-17.0.5+8',
description: """Provided java version will be installed with asdf
Examples: adoptopenjdk-11.0.22+7, adoptopenjdk-17.0.11+9
""")

string(name: 'MAVEN_VERSION',
defaultValue: 'from .tool-versions',
defaultValue: '3.8.8',
description: """Provided maven version will be installed with asdf
Examples: 3.8.8, 3.9.9, 4.0.0-beta-4
Examples: 3.8.8, 4.0.0-beta-4
""")

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -250,19 +250,14 @@ pipeline {
}

///////////////////////////////////////////
// edit mvn and java version
// edit java version
///////////////////////////////////////////
script {
echo "edit asdf tool version with version from jenkins param"

if (params.JAVA_VERSION != 'from .tool-versions') {
asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'java', params.JAVA_VERSION)
}
asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'java', params.JAVA_VERSION)
jenkinsJobTools.job_description_append("Use java version: $params.JAVA_VERSION ")

if (params.MAVEN_VERSION != 'from .tool-versions') {
asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'maven', params.MAVEN_VERSION)
}
asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'maven', params.MAVEN_VERSION)
jenkinsJobTools.job_description_append("Use maven version: $params.MAVEN_VERSION ")

}
Expand Down
2 changes: 1 addition & 1 deletion component-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<version>${javadoc-plugin.version}</version>
<configuration>
<splitindex>true</splitindex>
<linksource>true</linksource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import javax.json.bind.annotation.JsonbPropertyOrder;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* This class is dedicated to Studio's guess schema feature.
Expand All @@ -30,7 +29,6 @@
* See me TCOMP-2342 for more details.
*/
@Data
@EqualsAndHashCode(callSuper = true)
@JsonbPropertyOrder({ "localizedMessage", "message", "stackTrace", "suppressed", "possibleHandleErrorWith" })
public class DiscoverSchemaException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>@maven-install-plugin.version@</version>
<version>2.5.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>@maven-deploy-plugin.version@</version>
<version>@deploy-plugin.version@</version>
<configuration>
<skip>true</skip>
</configuration>
Expand All @@ -121,7 +121,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>@maven-shade-plugin.version@</version>
<version>@shade-plugin.version@</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.talend.sdk.component.runtime.beam.coder.JsonpJsonObjectCoder;

import lombok.Data;
import lombok.EqualsAndHashCode;

public class ASource extends BoundedSource<JsonObject> {

Expand Down Expand Up @@ -79,7 +78,6 @@ private static void assertClassLoader() {
}

@Data
@EqualsAndHashCode(callSuper = true)
private static class AReader extends BoundedReader<JsonObject> {

private final ASource source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,29 @@ void coerce() {
assertEquals(new Date(1000l), MappingUtils.coerce(Date.class, 1000l, name));
// === non-matching types ===
// number classes mapping
assertEquals(shorty, MappingUtils.coerce(short.class, shorty, name));
assertEquals(shorty, MappingUtils.coerce(short.class, new Short(shorty), name));
assertEquals(shorty, MappingUtils.coerce(Short.class, shorty.shortValue(), name));
assertEquals(Byte.valueOf("123"), MappingUtils.coerce(Byte.class, 123l, name));
assertEquals(Byte.valueOf("123"), MappingUtils.coerce(byte.class, 123l, name));
assertEquals(BigDecimal.valueOf(12345.67891), MappingUtils.coerce(BigDecimal.class, 12345.67891, name));
assertEquals(shorty.intValue(), MappingUtils.coerce(Integer.class, shorty, name));
// ==== mapping primitive <-> Class ====
assertEquals(Boolean.TRUE, MappingUtils.coerce(Boolean.class, true, name));
assertEquals('c', MappingUtils.coerce(char.class, 'c', name));
assertEquals('c', MappingUtils.coerce(Character.class, 'c', name));
assertEquals(123, MappingUtils.coerce(int.class, 123, name));
assertEquals(123, MappingUtils.coerce(Integer.class, 123, name));
assertEquals(123l, MappingUtils.coerce(long.class, 123l, name));
assertEquals(123l, MappingUtils.coerce(Long.class, 123l, name));
assertEquals(123.456f, MappingUtils.coerce(float.class, 123.456, name));
assertEquals(123.456f, MappingUtils.coerce(Float.class, 123.456f, name));
assertEquals(123.456, MappingUtils.coerce(double.class, 123.456, name));
assertEquals(123.456, MappingUtils.coerce(Double.class, 123.456, name));
assertEquals('c', MappingUtils.coerce(char.class, new Character('c'), name));
assertEquals(new Character('c'), MappingUtils.coerce(Character.class, 'c', name));
assertEquals(123, MappingUtils.coerce(int.class, new Integer(123), name));
assertEquals(new Integer(123), MappingUtils.coerce(Integer.class, 123, name));
assertEquals(123l, MappingUtils.coerce(long.class, new Long(123), name));
assertEquals(new Long(123), MappingUtils.coerce(Long.class, 123, name));
assertEquals(123.456f, MappingUtils.coerce(float.class, new Float(123.456), name));
assertEquals(new Float(123.456), MappingUtils.coerce(Float.class, 123.456f, name));
assertEquals(123.456, MappingUtils.coerce(double.class, new Double(123.456), name));
assertEquals(new Double(123.456), MappingUtils.coerce(Double.class, 123.456, name));

assertEquals("1000", MappingUtils.coerce(String.class, 1000l, name));
// string mapping
assertEquals('c', MappingUtils.coerce(char.class, "c", name));
assertEquals('c', MappingUtils.coerce(Character.class, "c", name));
assertEquals(new Character('c'), MappingUtils.coerce(Character.class, "c", name));
assertEquals(Character.MIN_VALUE, MappingUtils.coerce(Character.class, "", name));
assertEquals(true, MappingUtils.coerce(Boolean.class, "true", name));
assertEquals(true, MappingUtils.coerce(boolean.class, "true", name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = PRIVATE)
// as deprecation was introduced since = "17", can ignore it for now...
@SuppressWarnings({ "deprecation", "removal" })
public final class Unsafes {

private static final Object UNSAFE;
Expand Down
52 changes: 1 addition & 51 deletions component-runtime-testing/component-runtime-beam-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,6 @@
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-beam</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-inject-plexus</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
Expand All @@ -77,43 +59,11 @@
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-named-locks</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-spi</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-core</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -164,7 +114,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<version>${javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<version>${javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public void evaluate() throws Throwable {
new InetSocketAddress("localhost", API.getPort()))));
connection.setConnectTimeout(30000);
connection.setReadTimeout(20000);
connection.setRequestProperty("Accept", "*/*");
connection.setRequestProperty("Accept-Encoding", "gzip");
connection.setRequestProperty("Authorization", "should be filtered");
connection.setRequestProperty("ok", "yes");
Expand All @@ -128,7 +127,7 @@ public void evaluate() throws Throwable {
final String lines = String.join("\n", Files.readAllLines(output));
assertJSONEquals("[\n" + " {\n" + " \"request\":{\n" + " \"headers\":{\n"
+ " \"content-length\":\"0\",\n"
+ " \"Accept\":\"*/*\",\n"
+ " \"Accept\":\"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\",\n"
+ " \"Accept-Encoding\":\"gzip\",\n" + " \"ok\":\"yes\",\n"
+ " \"Proxy-Connection\":\"keep-alive\"\n" + " },\n" + " \"method\":\"GET\",\n"
+ " \"uri\":\"http://localhost:" + server.getAddress().getPort() + "/supertest\"\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public void evaluate() throws Throwable {
new InetSocketAddress("localhost", API.getPort()))));
connection.setConnectTimeout(30000);
connection.setReadTimeout(20000);
connection.setRequestProperty("Accept", "*/*");
connection.setRequestProperty("Authorization", "should be filtered");
connection.setRequestProperty("ok", "yes");
assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
Expand All @@ -118,7 +117,7 @@ public void evaluate() throws Throwable {
final String lines = String.join("\n", Files.readAllLines(output));
assertJSONEquals("[\n" + " {\n" + " \"request\":{\n" + " \"headers\":{\n"
+ " \"content-length\":\"0\",\n"
+ " \"Accept\":\"*/*\",\n"
+ " \"Accept\":\"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\",\n"
+ " \"ok\":\"yes\",\n" + " \"Proxy-Connection\":\"keep-alive\"\n" + " },\n"
+ " \"method\":\"GET\",\n" + " \"uri\":\"http://localhost:"
+ server.getAddress().getPort() + "/supertest\"\n" + " },\n" + " \"response\":{\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public void evaluate() throws Throwable {
new InetSocketAddress("localhost", API.getPort()))));
connection.setConnectTimeout(30000);
connection.setReadTimeout(20000);
connection.setRequestProperty("Accept", "*/*");
connection.setHostnameVerifier((h, s) -> true);
connection.setSSLSocketFactory(server.getHttpsConfigurator().getSSLContext().getSocketFactory());
assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
Expand All @@ -136,7 +135,7 @@ public void evaluate() throws Throwable {
final String lines = String.join("\n", Files.readAllLines(output));
assertJSONEquals("[\n" + " {\n" + " \"request\":{\n" + " \"headers\":{\n"
+ " \"content-length\":\"0\",\n"
+ " \"Accept\":\"*/*\",\n"
+ " \"Accept\":\"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\",\n"
+ " \"Connection\":\"keep-alive\"\n" + " },\n" + " \"method\":\"GET\",\n"
+ " \"uri\":\"https://localhost:" + server.getAddress().getPort() + "/supertest\"\n"
+ " },\n" + " \"response\":{\n" + " \"headers\":{\n"
Expand Down
2 changes: 1 addition & 1 deletion component-runtime-testing/component-runtime-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<version>${javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
3 changes: 1 addition & 2 deletions component-runtime-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@

<properties>
<wagon.version>3.4.0</wagon.version>
<shrinkwrap.version>3.3.1</shrinkwrap.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>${shrinkwrap.version}</version>
<version>3.1.4</version>
<exclusions>
<exclusion>
<groupId>org.jsoup</groupId>
Expand Down
1 change: 1 addition & 0 deletions component-starter-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
</scripts>
<properties>
<gradleHome>${project.build.directory}/gradle-${gradle.version}</gradleHome>
<mvnVersion>${mvn.version}</mvnVersion>
</properties>
</configuration>
<dependencies>
Expand Down
7 changes: 3 additions & 4 deletions component-starter-server/src/build/GrabMavenWrapper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ def validateWrapperFile(File baseDir, String file){
case "mvnw":
if(!from.text.contains('exec "$JAVACMD" \\\n' +
' $MAVEN_OPTS \\\n' +
' $MAVEN_DEBUG_OPTS \\\n' +
' -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \\\n' +
' "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \\\n' +
' "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \\\n' +
' ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"')){
throw new IllegalStateException("Invalid file: " + file);
}
break
case "mvnw.cmd":
if(!from.text.contains('%MAVEN_JAVA_EXE% ^')){
if(!from.text.contains('%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*')){
throw new IllegalStateException("Invalid file: " + file);
}
break
Expand All @@ -54,7 +53,7 @@ final int exit = new ProcessBuilder().inheritIO()
.directory(fakeProject)
.command(
new File(System.getProperty('maven.home'), "bin/" + mvnCommand).getAbsolutePath(),
"-N", "-Dtype=bin", "wrapper:wrapper")
"-N", "io.takari:maven:wrapper", "-Dmaven=" + mvnVersion)
.start().waitFor()
if (exit != 0) {
throw new IllegalStateException("bad exit status generating maven wrapper: " + exit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
package org.talend.sdk.component.starter.server.service.openapi.model.openapi;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class Header extends Parameter {

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
import org.talend.sdk.component.starter.server.service.openapi.model.common.OperationBase;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* Describes a single API operation on a path.
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class Operation extends OperationBase {

/**
Expand Down
Loading

0 comments on commit 0d93fc5

Please sign in to comment.