Skip to content

HLRC build in master doesn't enforce Java 8 compatibility #74289

@swallez

Description

@swallez

Description of the problem including expected versus actual behavior:

The Java clients should be compatible with Java 8. The work in #73910 introduced the use of Optional.isEmpty() in the HLRC code, which was added in Java 11. The build and CI tests accepted this.

When backporting to 7.x in #74272, the build failed because this method doesn't exist in Java 8 (see commit 1345a05 that fixed it).

So Java 8 compatibility in HLRC isn't enforced in master while it is in 7.x. Comparing build.gradle in the two branches did not show anything obvious that could explain this difference.

Steps to reproduce:

Add a usage of Optional.isEmpty() in RestHighLevelClient.java: it compiles in master when it should not, and rightly fails to compile in 7.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions