[code-reflection] RFR: Add support for more types [v2]
Paul Sandoz
psandoz at openjdk.org
Thu Apr 25 18:37:52 UTC 2024
On Thu, 25 Apr 2024 10:24:43 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add support for type-variable owner
>
> src/java.base/share/classes/java/lang/reflect/code/type/CoreTypeFactory.java line 128:
>
>> 126: throw new IllegalArgumentException("Bad type-variable bounds: " + tree);
>> 127: }
>> 128: String[] parts = identifier.split("::");
>
> And this is the duplicate parsing logic (although here we already know if it's a method or a class type-variable based on the number of `::`)
I am wondering if instead we can check `#`, and the parsers job is dumbly accumulate all valid characters (selected tokens and identifiers) up to but not including the `<` token. We could even check if there is quoted string for the type identifier.
Note the special code for arrays in the parser was added only to avoid updating many tests.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/51#discussion_r1579967083
More information about the babylon-dev
mailing list