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

Fix Issue 2393 #2470

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -44,11 +44,13 @@
import com.sun.source.tree.IdentifierTree;
import com.sun.source.tree.MemberSelectTree;
import com.sun.source.tree.MethodInvocationTree;
import com.sun.source.tree.StatementTree;
import com.sun.source.tree.SwitchTree;
import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.VarSymbol;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;

Expand Down Expand Up @@ -100,8 +102,9 @@ public Description matchSwitch(SwitchTree tree, VisitorState state) {

scanForInvalidGetters(getters, allowableGetters, caseTree, receiverSymbolChain.get(), state);

if (!caseTree.getStatements().isEmpty()
&& !canCompleteNormally(getLast(caseTree.getStatements()))) {
List<? extends StatementTree> statements = caseTree.getStatements();
if (statements != null && !statements.isEmpty()
&& !canCompleteNormally(getLast(statements))) {
allowableGetters.clear();
}
}
Expand Down