c2nes / javalang

Pure Python Java parser and tools
MIT License
737 stars 161 forks source link

Error when parsing something like `Arrays.<Object> asList ( "a" , "b" )` #126

Open ztw33 opened 2 years ago

ztw33 commented 2 years ago

When use javalang.parser.Parser to parse some statements like Arrays.<Object> asList ( "a" , "b" ), the node is printed as:

MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="a"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="b")], member=Arrays, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))])

While the qualifier of this MethodInvocation should be Arrays and the member should be asList.