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

[3.0] fix parameters handling #402

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

Ladicek
Copy link
Collaborator

@Ladicek Ladicek commented Jun 13, 2024

No description provided.

These 2 changes in JDK 18 and JDK 21 require significant changes to
how synthetic/mandated parameters and parameters names are handled:

- https://bugs.openjdk.org/browse/JDK-8271623
- https://bugs.openjdk.org/browse/JDK-8292275

Therefore, with this commit, the `Indexer` no longer stores just method
parameter name arrays. Instead, for each `MethodInfo` from currently
processed class, it stores a `MethodParamList`, which contains 2 lists
of `ParamData`, one based on the `MethodParameters` bytecode attribute
and the other based on the local variable table. Those lists contain,
for each method parameter, its name and synthetic/mandated flag.

When the `Indexer` is done parsing a method, the `MethodParamList`
is finished, which means computing:

- whether the method is a constructor whose first parameter is the
  enclosing instance synthetic/mandated parameter;
- list of parameters that are possibly named (synthetic/mandated
  parameters are ignored).

This information is then used:

- to compute the final array of parameter names (preferring the proper
  name over the debug name);
- as part of a heuristic that figures out if a constructor belongs
  to an "inner" class (in case of local/anonymous classes, that in fact
  means figuring out if they were declared in non-static context).
@Ladicek Ladicek force-pushed the fix-parameters-handling-3.0 branch from ad8c231 to 13260c8 Compare June 13, 2024 09:39
They used to fail because of the ImpSort Maven plugin, which got
inherited from the SmallRye Parent POM. This commit gets rid of
the SmallRye Parent POM from the integration tests, because it's
not necessary, and adds some minimal properties all Maven projects
should have. The integration tests no longer run the ImpSort Maven
plugin, which means they run with Maven 3.9 just fine.
@Ladicek Ladicek force-pushed the fix-parameters-handling-3.0 branch from 13260c8 to ea78b87 Compare June 13, 2024 09:47
@Ladicek Ladicek marked this pull request as ready for review June 14, 2024 08:27
@Ladicek Ladicek added this to the 3.0.8 milestone Jul 2, 2024
@Ladicek Ladicek merged commit 9755c7f into smallrye:3.0 Jul 2, 2024
31 checks passed
@Ladicek Ladicek deleted the fix-parameters-handling-3.0 branch July 2, 2024 09:38
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant