Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Java: Add aliases for CodeQL classes with unintuitive name #14555

Marcono1234 started this conversation in Ideas
Discussion options

Description of the issue

There are CodeQL classes for Java whose name are not that intuitive and which might therefore make it more difficult for users to discover and to understand what they do.

CodeQL class Suggested alias Rationale
MethodAccess MethodCall Superclass is named Call. And this basically seems to be a "method call". "access" sounds a bit too unspecific, for example a method reference expression is not a MethodAccess (its synthetic anonymous class has a MethodAccess though) but one could think it is based on the name.
LValue, RValue VarWrite, VarRead Superclass is named VarAccess; other subclasses are named FieldWrite, FieldRead. The terms LValue, RValue are not / rarely used in the context of Java. The only mention in the JLS seems to be a comparison with C ("in C, this would be called an lvalue").
ClassInstanceExpr NewExpr?
(probably needs a better name since this does not cover creation of arrays which also uses new)
(Personal) While the term "ClassInstanceExpr" seems to be correct according to the JLS, I don't think it is commonly used.
MemberRefExpr MethodRefExpr? CodeQL's name is possibly more correct because they can also refer to non-method callables such as constructors, but the JLS calls them "method reference expressions".
more? ... ...

What do you think?

This is only a rough suggestion for now, I haven't considered all aspects of this yet such as whether it would make sense to deprecate the existing names eventually, whether the two separate names will increase confusion, or how to deal with subclasses or predicates using the same (unintuitive) name.
I just wanted to generally hear what you think about this.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

We did MethodCall, VarWrite, VarRead and NewClassExpr (which is smaller than ClassInstanceExpr, excluding implicit creation) in #14575

You must be logged in to vote
1 reply
Comment options

Oh wow, thanks a lot! I initially only hoped to get a discussion started and maybe to have these added as additional aliases, but it is great that you apparently liked this suggestion and directly implemented the changes.

For NewClassExpr I think personally it is a bit misleading since it sounds as if it creates a new class. What do you think about NewInstanceExpr instead (though maybe that one has its downsides as well)? But this is probably not a big issue.

Unfortunately it looks like documentation (including screenshots) is also affected by these changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /