-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve handling of synthetic parameters and parameter names
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).
- Loading branch information
Showing
2 changed files
with
252 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.