Skip to content

Java nested lambdas formatting is incredibly poorΒ #990

Closed
@kberezin-nshl

Description

@kberezin-nshl

I already posted a comment: #137 (comment)
but it was ignored.

Duplicating here.

Elasticsearch API. What I would like to have:

      var hits =
          elasticsearchClient
              .search(r -> r.index(indexName)
                  .query(q -> q.bool(
                      b -> b
                          .must(job -> job.match(t -> t.field("job_id").query(jobId)))
                          .must(str -> str.queryString(
                              qs -> qs.query("\"%s\"".formatted(searchString))))))
                  .size(request.getPageSize()),
                  Doc.class);

what I get:

      var hits =
          elasticsearchClient
              .search(
                  r ->
                      r.index(indexName)
                          .query(
                              q ->
                                  q.bool(
                                      b ->
                                          b.must(
                                                  job ->
                                                      job.match(
                                                          t -> t.field("job_id").query(jobId)))
                                              .must(
                                                  str ->
                                                      str.queryString(
                                                          qs ->
                                                              qs.query(
                                                                  "\"%s\""
                                                                      .formatted(searchString))))))
                          .size(request.getPageSize()),
                  Doc.class);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions