-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
@@ -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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 1210.
|
||
breakTo(target); |
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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).
No description provided.