Consider supporting JEP 445

Open
#209 0 comments 0 reactions 1 assignee View on GitHub

@janell-chen is already working on this.

Since Jun 6, 2023.

Assessment

This issue has not been assessed yet.

Description

enhancement P3

JEP 445 (Preview in JDK 21) introduces unnamed classes and instance main methods. This could be a boon to writing functions if done right changing our result from this:

package com.example;

import com.google.cloud.functions.HttpFunction;
import com.google.cloud.functions.HttpRequest;
import com.google.cloud.functions.HttpResponse;

public class HelloWorld implements HttpFunction {
  @Override
  public void service(HttpRequest request, HttpResponse response)
      throws Exception {
    response.getWriter().write("Hello, World\n");
  }
}

To something like this:

import com.google.cloud.functions.FuncFramework;

void main() {
    FuncFramework.http((req, res) -> response.getWriter().write("Hello, World\n"));
}
Dominant language
Java
Stars
154
Forks
63
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GoogleCloudPlatform/functions-framework-java

All issues in GoogleCloudPlatform/functions-framework-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.