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

KAFKA-4501: Java 9 compilation and runtime fixes #3647

Closed
wants to merge 9 commits into from

Conversation

ijuma
Copy link
Contributor

@ijuma ijuma commented Aug 9, 2017

Compilation error fixes:

Compilation warning fixes:

  • Avoid deprecated Class.newInstance in Utils.newInstance
  • Silence a few Java 9 deprecation warnings
  • var -> val and unused fixes

Runtime error fixes:

  • Introduce Base64 class that works in Java 7 and Java 9

Also:

  • Set --release option if building with Java 9

Note that tests involving EasyMock (easymock/easymock#193)
or PowerMock (powermock/powermock#783)
will fail as neither supports Java 9 currently.

@asfgit
Copy link

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6636/
Test FAILed (JDK 8 and Scala 2.12).

@ijuma
Copy link
Contributor Author

ijuma commented Aug 9, 2017

retest this please

@asfgit
Copy link

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6637/
Test FAILed (JDK 8 and Scala 2.12).

@asfgit
Copy link

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6652/
Test FAILed (JDK 7 and Scala 2.11).

@ijuma ijuma force-pushed the kafka-4501-support-java-9 branch from 1fca2f0 to 2e92b1d Compare August 9, 2017 08:31
@ijuma ijuma changed the title KAFKA-4501: Java 9 compilation fixes KAFKA-4501: Java 9 compilation and runtime fixes Aug 9, 2017
@asfgit
Copy link

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6661/
Test PASSed (JDK 7 and Scala 2.11).

@ijuma
Copy link
Contributor Author

ijuma commented Aug 9, 2017

Review by @hachikuji.

@asfgit
Copy link

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6646/
Test PASSed (JDK 8 and Scala 2.12).

@asfgit
Copy link

asfgit commented Aug 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6694/
Test PASSed (JDK 7 and Scala 2.11).

@asfgit
Copy link

asfgit commented Aug 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6679/
Test PASSed (JDK 8 and Scala 2.12).

@ijuma
Copy link
Contributor Author

ijuma commented Aug 13, 2017

@hachikuji, https://builds.apache.org/job/kafka-trunk-jdk9/1/console shows that the build compiles with Java 9, but EasyMock/PowerMock tests fail.

Copy link

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straightforward. Just a couple questions.

@@ -269,8 +270,8 @@ object LogConfig {
*/
def fromProps(defaults: java.util.Map[_ <: Object, _ <: Object], overrides: Properties): LogConfig = {
val props = new Properties()
props.putAll(defaults)
props.putAll(overrides)
defaults.asScala.foreach { case (k, v) => props.put(k, v) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why you didn't add another implicit ++= for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key type is Object instead of String, which is unsafe. We should probably change the type of the map received by LogConfig but I didn't want to tackle that here.

protected ScramSaslClientProvider() {
super("SASL/SCRAM Client Provider", 1.0, "SASL/SCRAM Client Provider for Kafka");
for (ScramMechanism mechanism : ScramMechanism.values())
super.put("SaslClientFactory." + mechanism.mechanismName(), ScramSaslClientFactory.class.getName());
put("SaslClientFactory." + mechanism.mechanismName(), ScramSaslClientFactory.class.getName());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The super qualifier didn't achieve anything.

}
URL_ENCODE_NO_PADDING = encode.bindTo(juUrlEncoderNoPassing);


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we need the extra newlines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unintentional, will fix.

Copy link

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will let you merge when you fix the unneeded newlines.

@ijuma
Copy link
Contributor Author

ijuma commented Aug 19, 2017

Fixed the empty lines, merging to trunk.

@asfgit asfgit closed this in ed96523 Aug 19, 2017
@ijuma ijuma deleted the kafka-4501-support-java-9 branch August 22, 2017 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants