You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "frankvicky (via GitHub)" <gi...@apache.org> on 2024/10/09 07:43:20 UTC
[PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
frankvicky opened a new pull request, #17426:
URL: https://github.com/apache/kafka/pull/17426
JIRA: [KAFKA-17739](https://issues.apache.org/jira/browse/KAFKA-17739)
> 1. minJavaVersion=11
> 2. remove sourceCompatibility and targetCompatibility
> 3. cleanup all compatibility checks
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #17426:
URL: https://github.com/apache/kafka/pull/17426
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1794636021
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on PR #17426:
URL: https://github.com/apache/kafka/pull/17426#issuecomment-2495168768
@frankvicky @chia7712
I just recognized that I cannot build `trunk` using Java 11 any longer:
I tracked it down to this PR -- before this commit, it works, but this commit seems to break it:
```
$ ./gradlew systemTestLibs
> Configure project :
Starting build with version 4.0.0-SNAPSHOT (commit id 1ece9184) using Gradle 8.10, Java 11 and Scala 2.13.15
Build properties: ignoreFailures=false, maxParallelForks=16, maxScalacThreads=8, maxTestRetries=0
[...]
> Task :jmh-benchmarks:compileJava
warning: No processor claimed any of these annotations: java.base/java.lang.SuppressWarnings,java.base/java.lang.Override
error: warnings found and -Werror specified
1 error
1 warning
> Task :jmh-benchmarks:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jmh-benchmarks:compileJava'.
> Compilation failed; see the compiler error output for details.
[...]
```
`trunk` still compiles with Java17 and Java21 though. Can you take a look?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1793681057
##########
gradle/spotbugs-exclude.xml:
##########
@@ -547,5 +547,10 @@ For a detailed description of spotbugs bug categories, see https://spotbugs.read
</Or>
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
</Match>
+ <Match>
+ <!-- Suppress warning about using static DateFormat in a multithreaded context -->
+ <Class name="org.apache.kafka.tools.ReplicaVerificationTool$ReplicaBuffer"/>
+ <Bug pattern="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE"/>
+ </Match>
Review Comment:
No, it might be a concern, but I suppress it since this test is going to be deleted.
I don't think it's very meaningful to fix it at this moment. 🤔
https://github.com/apache/kafka/blob/bb6ebd83f9a0f9b2a37704f1f37b78a48cf480e1/tools/src/main/java/org/apache/kafka/tools/ReplicaVerificationTool.java#L115
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1793053700
##########
trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonSerializationTest.java:
##########
@@ -74,7 +74,7 @@ private <T> void verify(T val1) throws Exception {
Class<T> clazz = (Class<T>) val1.getClass();
T val2 = JsonUtil.JSON_SERDE.readValue(bytes, clazz);
for (Field field : clazz.getDeclaredFields()) {
- boolean wasAccessible = field.isAccessible();
+ boolean wasAccessible = field.canAccess(val2);
Review Comment:
`.isAccessible()` has been deprecated since Java 9.
The documentation recommends using `.canAccess(object)` instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1794561595
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
@frankvicky Could you please also update KIP-750?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17426:
URL: https://github.com/apache/kafka/pull/17426#issuecomment-2496166279
@mjsax it seems that is a JDK issue (https://bugs.openjdk.org/browse/JDK-8193214), and the fix is backported to `11.0.13`. I check the build on 11.0.13 and it works.
```
BUILD SUCCESSFUL in 15m 18s
561 actionable tasks: 561 executed
root@1f5e165f48b1:/kafka# cd kafka/^C
root@1f5e165f48b1:/kafka# java -version
openjdk version "11.0.13" 2021-10-19 LTS
OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)
root@1f5e165f48b1:/kafka#
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17426:
URL: https://github.com/apache/kafka/pull/17426#issuecomment-2495290937
@mjsax thanks for this report. we will check it today
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on PR #17426:
URL: https://github.com/apache/kafka/pull/17426#issuecomment-2496281577
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "omkreddy (via GitHub)" <gi...@apache.org>.
omkreddy commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1806954054
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
@chia7712 @frankvicky looks like this removal of sourceCompatibility, targetCompatibility Java compile options from build.gradle is not setting the Scala compile target version correctly. I have prepared a build with JDK17 and getting UnsupportedClassVersionError for Scala classes while trying to start with JDK 11.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "omkreddy (via GitHub)" <gi...@apache.org>.
omkreddy commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1806963381
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
I tried to fix here: https://github.com/apache/kafka/pull/17546
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on PR #17426:
URL: https://github.com/apache/kafka/pull/17426#issuecomment-2496133760
Still getting the error with "clean" option. What Java are you using?
```
$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1793051797
##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorage.java:
##########
@@ -254,9 +255,10 @@ public void configure(Map<String, ?> configs) {
if (transfererClass != null) {
try {
- transferer = (Transferer) getClass().getClassLoader().loadClass(transfererClass).newInstance();
-
- } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | ClassCastException e) {
+ transferer = (Transferer) getClass().getClassLoader().loadClass(transfererClass)
+ .getDeclaredConstructor().newInstance();
Review Comment:
`clazz.newInstance()` has been deprecated since Java 9.
The documentation recommends using `clazz.getDeclaredConstructor().newInstance()` instead.”
##########
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/OAuthBearerSaslClientProvider.java:
##########
@@ -27,7 +27,7 @@ public class OAuthBearerSaslClientProvider extends Provider {
@SuppressWarnings("this-escape")
protected OAuthBearerSaslClientProvider() {
- super("SASL/OAUTHBEARER Client Provider", 1.0, "SASL/OAUTHBEARER Client Provider for Kafka");
+ super("SASL/OAUTHBEARER Client Provider", "1.0", "SASL/OAUTHBEARER Client Provider for Kafka");
put("SaslClientFactory." + OAuthBearerLoginModule.OAUTHBEARER_MECHANISM,
Review Comment:
`new Provider(String, double, String)` has been deprecated since Java 9.
The documentation recommends using `new Provider(String, String, String)` instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "cadonna (via GitHub)" <gi...@apache.org>.
cadonna commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1793642071
##########
gradle/spotbugs-exclude.xml:
##########
@@ -547,5 +547,10 @@ For a detailed description of spotbugs bug categories, see https://spotbugs.read
</Or>
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
</Match>
+ <Match>
+ <!-- Suppress warning about using static DateFormat in a multithreaded context -->
+ <Class name="org.apache.kafka.tools.ReplicaVerificationTool$ReplicaBuffer"/>
+ <Bug pattern="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE"/>
+ </Match>
Review Comment:
Is this safe? There is a reason for that warning. Why should we suppress it?
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
Is this correct? Does the Scala plugin no more suffer from the issue described in the comment?
KIP-750 to modify these not to delete them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17426:
URL: https://github.com/apache/kafka/pull/17426#issuecomment-2495295817
@mjsax I can't reproduce the error. Could you please clean (`./gradlew clean`) project and try it again?
```
jenkins@50cc5fcf9828:~/repo$ ./gradlew clean systemTestLibs
> Configure project :
Starting build with version 4.0.0-SNAPSHOT (commit id d36b24f4) using Gradle 8.10.2, Java 11 and Scala 2.13.15
Build properties: ignoreFailures=false, maxParallelForks=24, maxScalacThreads=8, maxTestRetries=0
> Task :raft:processMessages
MessageGenerator: processed 1 Kafka message JSON files(s).
> Task :transaction-coordinator:processMessages
MessageGenerator: processed 2 Kafka message JSON files(s).
> Task :storage:processMessages
MessageGenerator: processed 5 Kafka message JSON files(s).
> Task :share-coordinator:processMessages
MessageGenerator: processed 4 Kafka message JSON files(s).
> Task :streams:processMessages
MessageGenerator: processed 1 Kafka message JSON files(s).
> Task :metadata:processMessages
MessageGenerator: processed 25 Kafka message JSON files(s).
> Task :group-coordinator:processMessages
MessageGenerator: processed 32 Kafka message JSON files(s).
> Task :clients:processMessages
MessageGenerator: processed 186 Kafka message JSON files(s).
> Task :clients:processTestMessages
MessageGenerator: processed 4 Kafka message JSON files(s).
> Task :clients:compileTestJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 36s
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1793685012
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
Thanks for pointing out.
I think it is a mistake, I will add it back
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1794549101
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
Thanks for information 😺
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1793048040
##########
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/OAuthBearerSaslClientProvider.java:
##########
@@ -27,7 +27,7 @@ public class OAuthBearerSaslClientProvider extends Provider {
@SuppressWarnings("this-escape")
protected OAuthBearerSaslClientProvider() {
- super("SASL/OAUTHBEARER Client Provider", 1.0, "SASL/OAUTHBEARER Client Provider for Kafka");
+ super("SASL/OAUTHBEARER Client Provider", "1.0", "SASL/OAUTHBEARER Client Provider for Kafka");
put("SaslClientFactory." + OAuthBearerLoginModule.OAUTHBEARER_MECHANISM,
Review Comment:
`new Provider(String, double, String)` has been deprecated since Java 9.
Document recommend to use `new Provider(String, String, String)` instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1794544959
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
I've checked the latest Scala plugin, and the `-target` option is no longer included.
```
<parameter value="-release" />
<parameter value="11" />
```
Additionally, based on the discussion (https://youtrack.jetbrains.com/issue/SCL-21039/Dont-set-parameter-value-target-in-.idea-scalacompiler.xml-when-Gradle-build-is-using-release-flag-applies-for-Gradle-8.0.1#focus=Comments-27-7380486.0-0), it seems the issue has already been fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1793051797
##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorage.java:
##########
@@ -254,9 +255,10 @@ public void configure(Map<String, ?> configs) {
if (transfererClass != null) {
try {
- transferer = (Transferer) getClass().getClassLoader().loadClass(transfererClass).newInstance();
-
- } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | ClassCastException e) {
+ transferer = (Transferer) getClass().getClassLoader().loadClass(transfererClass)
+ .getDeclaredConstructor().newInstance();
Review Comment:
`clazz.newInstance()` has been deprecated since Java 9.
The documentation recommends using `clazz.getDeclaredConstructor().newInstance()` instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1794449374
##########
build.gradle:
##########
@@ -328,6 +315,10 @@ subprojects {
targetCompatibility = minJavaVersion
}
+ compileJava {
Review Comment:
why we need this when line#307 does similar change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1794523138
##########
build.gradle:
##########
@@ -328,6 +315,10 @@ subprojects {
targetCompatibility = minJavaVersion
}
+ compileJava {
Review Comment:
Oops, I got it wrong. I will fix it soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17739: Clean up build.gradle to adopt the minimum Java version as 11 [kafka]
Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on PR #17426:
URL: https://github.com/apache/kafka/pull/17426#issuecomment-2496135661
There is only one `@SuppressWarnings("deprecation")` in the jmh module in `ProducerResponseBenchmark.java` -- if I remove it, one of both errors goes away.
But there is 40 `@Overwrite` annotation. Not sure if there is a single offending one, or if all a are a problem. 40 is too many to try the out one-by-one.
Not sure if this is useful information to track it down?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org