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

fix getDecoder #502

Merged
merged 1 commit into from
Mar 2, 2018
Merged

fix getDecoder #502

merged 1 commit into from
Mar 2, 2018

Conversation

jilen
Copy link
Contributor

@jilen jilen commented Feb 26, 2018

No description provided.

@eed3si9n
Copy link
Member

eed3si9n commented Feb 26, 2018

Thanks!
Looks like this got in 2b875db.
Do you mind adding a test case somewhere around https://github.com/sbt/zinc/tree/1.x/internal/zinc-persist/src/test/scala/sbt/inc/text?

@eed3si9n eed3si9n mentioned this pull request Feb 26, 2018
@eed3si9n
Copy link
Member

 private[sbt] object Base64 {
   lazy val factory: () => Base64 = {
     try {
       new Java678Encoder().encode(Array[Byte]())
       () =>
         new Java678Encoder()
     } catch {
       case _: LinkageError =>
         () =>
           new Java89Encoder
     }
   }
 }

Does this mean we need Java 9 to test this?

@jilen
Copy link
Contributor Author

jilen commented Feb 26, 2018

@eed3si9n Alternatively we can test the Java89Encoder class directly, but that also requires java 8 at least

@eed3si9n
Copy link
Member

sbt 1.x requires Java 8, so that's no problem.

@typesafe-tools
Copy link

The validator has checked the following projects against Scala 2.12,
tested using dbuild, projects built on top of each other.

Project Reference Commit
sbt 1.1.x sbt/sbt@9a5b7bc
zinc pull/502/head 0b3717d
io 1.1.x sbt/io@13eb241
librarymanagement 1.1.x sbt/librarymanagement@69fb352
util 1.1.x sbt/util@9f12566
website 1.1.x

✅ The result is: SUCCESS
(restart)

@jilen
Copy link
Contributor Author

jilen commented Feb 26, 2018

@eed3si9n I've add a test case but that seems making nosense, is that ok ?

@eed3si9n
Copy link
Member

Would the test fail if you revert your fix? If so that's something.

Copy link
Member

@jvican jvican left a comment

Choose a reason for hiding this comment

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

LGTM, trusting the obvious syntactic error.

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

without the fix:

> zincPersist/testOnly sbt.inc.text.Base64Specification
[info] ! Base64.java89: Exception raised on property evaluation.
[info] > ARG_0: [B@18e5de43
[info] > Exception: java.lang.IllegalArgumentException: java.lang.ClassCastException@5433d119
[info] + Base64.java678: OK, passed 100 tests.
[info] ScalaCheck
[info] Failed: Total 2, Failed 0, Errors 1, Passed 1
[info] ScalaTest
[info] Run completed in 216 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0

with the fix

> zincPersist/testOnly sbt.inc.text.Base64Specification
[info] + Base64.java678: OK, passed 100 tests.
[info] + Base64.java89: OK, passed 100 tests.
[info] ScalaCheck
[info] Passed: Total 2, Failed 0, Errors 0, Passed 2
[info] ScalaTest
[info] Run completed in 217 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0

@jvican jvican merged commit b4432ca into sbt:1.1.x Mar 2, 2018
@jilen jilen deleted the fix_java89_decoder branch March 2, 2018 08:11
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.

None yet

5 participants