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

Improve documentation of commonAssignmentCheck and correct overrides #6347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smillst
Copy link
Member

@smillst smillst commented Dec 8, 2023

No description provided.

Copy link
Member

@mernst mernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few questions.

@@ -172,15 +171,16 @@ protected boolean commonAssignmentCheck(
}

@Override
@FormatMethod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

@@ -101,14 +104,11 @@ protected boolean commonAssignmentCheck(
}

if (isLessThan) {
// Print the messages because super isn't called.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

* <p>Because this method is not called for all pseudo-assignments, subclasses should only
* override this, if the tree of the value expression is required; otherwise, override {@link
* #commonAssignmentCheck(AnnotatedTypeMirror, AnnotatedTypeMirror, Tree, String, Object...)}. If
* this method is overridden, then the first then should call {@link
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify this?

* variableType} and emits an error message (through the compiler's messaging interface) if it is
* not valid.
*
* <p>Subclasses should override this method if in all cases unless the tree for the {@code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar issue here.

if (showchecks) {
TypeMirror exprTypeMirror = TreeUtils.typeOf(exprTree);
System.out.printf(
"%s %s (at %s): actual tree = %s %s%n expected: %s %s%n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this labeled "expected"? That doesn't seem to fit with shouldSkipUses(ExpressionTree).

@mernst mernst assigned smillst and unassigned mernst Dec 8, 2023
@mernst
Copy link
Member

mernst commented Jan 16, 2024

@smillst A ping in case this fell through the cracks. It isn't urgent, though.

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.

2 participants