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

Handling of switch expressions and rule cases in Flow and NPECheck hint. #35

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jlahoda
Copy link
Owner

@jlahoda jlahoda commented Aug 1, 2020

No description provided.

Repository owner deleted a comment from jlahoda-jackpot Aug 1, 2020
@@ -101,7 +101,8 @@
import javax.lang.model.type.TypeMirror;
import org.netbeans.api.java.source.CompilationInfo;
import org.netbeans.api.java.source.CompilationInfo.CacheClearPolicy;
import org.netbeans.api.java.source.support.CancellableTreePathScanner;
import org.netbeans.api.java.source.support.CancellableTreeScanner;
import org.netbeans.modules.editor.java.TreeShims;
Copy link
Owner Author

Choose a reason for hiding this comment

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

Line 105.

}

public Boolean scan(TreePath path, ConstructorData p) {
TreePath oldPath = currentPath;
Copy link
Owner Author

Choose a reason for hiding this comment

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

Line 455.

if (TreeShims.SWITCH_EXPRESSION.equals(tree.getKind().name())) {
result = visitSwitchExpression(tree, p);
} else if (TreeShims.YIELD.equals(tree.getKind().name())) {
result = visitYield(tree, p);
Copy link
Owner Author

Choose a reason for hiding this comment

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

Line 477.

@@ -1172,37 +1207,63 @@ public Boolean visitBreak(BreakTree node, ConstructorData p) {

Tree target = info.getTreeUtilities().getBreakContinueTargetTree(getCurrentPath());

resumeAfter(target, variable2State);
breakTo(target);
Copy link
Owner Author

Choose a reason for hiding this comment

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

Line 1210.


breakTo(target);
Copy link
Owner Author

Choose a reason for hiding this comment

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

Line 1220.

private void breakTo(Tree target) {
resumeAfter(target, variable2State);

variable2State = new HashMap< Element, State>();
Copy link
Owner Author

Choose a reason for hiding this comment

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

Line 1228.

variable2State = mergeOr(variable2State, origVariable2State);

if (ct.getExpression() == null) {
exhaustive = true;
}

scan(ct, null);

if (TreeShims.isRuleCase(ct)) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Line 1259.

private void breakTo(Tree target) {
resumeAfter(target, variable2State);

variable2State = new HashMap< Element, State>();

Choose a reason for hiding this comment

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

Jackpot:
warning: Redundant type arguments in new expression (use diamond operator instead).

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