Skip to content

3.x: [Java 8] Use diamond <> where possible in unit tests. #6767

Closed
@akarnokd

Description

@akarnokd

The upgrade to Java 8 caused more than 4,000 locations to report as diamond capable, including regular classes and tests.

In the first round, fix the unit test files, but beware:

  • Do not change the non-test files yet. (Avoid conflict with other cleanups and Java 8 additions.)
  • Do not change the existing tests' functional interface usages to lambdas. (Undoing lambdaification is extremely painful because tools guess the inner class types wrong almost always.)
  • On a rare occasion, the warning is wrong in the IDE and breaks the Gradle compilation with javac.

I'd appreciate this to be split between several PRs or ~100 file changes per PR tops to still be able to review them on GitHub.

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