-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add filter for Kotlin when-expressions that list all cases of enum #729
Conversation
6ca1df0
to
8b48e8d
Compare
final int sourceOpcode = j.source.getNode().getOpcode(); | ||
if ((sourceOpcode == Opcodes.LOOKUPSWITCH | ||
|| sourceOpcode == Opcodes.TABLESWITCH) | ||
&& ignored.contains(target.getNode())) { |
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.
Better to make this explicit.
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.
It looks like we don't have unit tests in MethodAnalyzerTest
which covers this?
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.
As was discussed by phone: this even should not be here - filter should play role during counting and should not change CFG construction.
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.
I believe that this can be replaced by API that is being developed in #735
33633a9
to
77a8dac
Compare
77a8dac
to
d623d15
Compare
@marchof rebased |
*/ | ||
public final class KotlinWhenSealedFilter implements IFilter { | ||
public final class KotlinWhenFilter implements IFilter { |
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.
@marchof we'll have KotlinWhenStringFilter
and KotlinWhenFilter
, but I didn't managed to find better name
d623d15
to
68e91e0
Compare
@Godin I rebased this PR. Can you please re-check before merge? |
No description provided.