Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micronaut: Add missing path variable parameter fix. #6498

Merged

Conversation

dbalek
Copy link
Contributor

@dbalek dbalek commented Sep 28, 2023

Micronaut reports error if a path variable is declared the URL path and the corresponding parameter is missing in a method signature. The quick-fix adds the missing parameter.

  @Get("/path/{variable}/")
  public String handle(String name_not_equal_to_variable) {
    ...
  }

@dbalek dbalek added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests Micronaut [ci] enable enterprise job labels Sep 28, 2023
@dbalek dbalek added this to the NB20 milestone Sep 28, 2023
@dbalek dbalek self-assigned this Sep 28, 2023
@mbien
Copy link
Member

mbien commented Sep 29, 2023

do the micronaut tests require a JDK 17 setup? They are still green but there are exceptions in the log:

    [junit] Caused by: java.lang.UnsupportedClassVersionError: io/micronaut/maven/testresources/TestResourcesLifecycleExtension has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
    [junit] 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    [junit] 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1022)

@dbalek dbalek force-pushed the dbalek/micronaut-add-missing-path-var-param branch from 068cce4 to 10ba82f Compare October 3, 2023 07:51
Copy link
Contributor

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me. One suggestion inline.

.github/workflows/main.yml Outdated Show resolved Hide resolved
@dbalek
Copy link
Contributor Author

dbalek commented Oct 3, 2023

JDK 17 is now used to run micronaut tests

do the micronaut tests require a JDK 17 setup? They are still green but there are exceptions in the log:

@dbalek dbalek force-pushed the dbalek/micronaut-add-missing-path-var-param branch from 10ba82f to 985e4b6 Compare October 3, 2023 10:02
@dbalek dbalek merged commit ed2d7bc into apache:master Oct 3, 2023
35 checks passed
@dbalek dbalek deleted the dbalek/micronaut-add-missing-path-var-param branch October 3, 2023 12:17
@mbien
Copy link
Member

mbien commented Oct 3, 2023

JDK 17 is now used to run micronaut tests

@dbalek thanks! Can confirm that the exception is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests Micronaut [ci] enable enterprise job
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants