Skip to content

Proposal: Move to Java 8 #6317

Closed
Closed
@ZacSweers

Description

@ZacSweers

With Android Gradle Plugin 3.2.0 being stable now, it brings a new D8 tool that includes Bazel's desugaring of Java 8 code. This has enabled the android library ecosystem to start moving to Java 8 (language features first, possibly backporting of APIs like streams in the future).

As a result, the android ecosystem (as well as libraries) have started being able to migrate to Java 8. Since that was an original design goal of RxJava 2, but backported to Java 6 for android compatibility, I propose we reconsider that now that the ecosystem has moved forward.

If the proposal's accepted, we could do most of the bulk work fairly easily in an automated pass with IDE tooling.

  • Change target/source languages in build.gradle to java 8
  • Run project-wide inspections from IntelliJ to migrate all anonymous inner classes that could be lambdas or method references
    • Run on main sources first, keep tests as-is for regression testing
    • After main is migrated and verified migrate tests in separate pass

Type annotations could be safely introduced solely for static analysis purposes (ref #6316)

Example community projects that have successfully moved to Java 8 (some android, some java, some both)

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions