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

Add filter for Kotlin when-expressions that list all cases of enum #729

Merged
merged 2 commits into from
Aug 18, 2018

Conversation

Godin
Copy link
Member

@Godin Godin commented Aug 13, 2018

No description provided.

@Godin Godin added this to the 0.8.2 milestone Aug 13, 2018
@Godin Godin self-assigned this Aug 13, 2018
@Godin Godin requested a review from marchof August 13, 2018 01:18
@Godin Godin added this to IN PROGRESS in Filtering Aug 13, 2018
final int sourceOpcode = j.source.getNode().getOpcode();
if ((sourceOpcode == Opcodes.LOOKUPSWITCH
|| sourceOpcode == Opcodes.TABLESWITCH)
&& ignored.contains(target.getNode())) {
Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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

@Godin Godin removed the request for review from marchof August 13, 2018 16:51
@Godin Godin added this to IN PROGRESS in Current work items Aug 13, 2018
@Godin Godin force-pushed the kotlin_when_enum branch 2 times, most recently from 33633a9 to 77a8dac Compare August 15, 2018 16:31
@Godin Godin moved this from Implementation to Review in Current work items Aug 16, 2018
@marchof
Copy link
Member

marchof commented Aug 17, 2018

@Godin Would prefer to review this after #735 is merged to master.

@Godin Godin moved this from Review to Implementation in Current work items Aug 17, 2018
@Godin
Copy link
Member Author

Godin commented Aug 17, 2018

@marchof rebased

@Godin Godin moved this from Implementation to Review in Current work items Aug 17, 2018
*/
public final class KotlinWhenSealedFilter implements IFilter {
public final class KotlinWhenFilter implements IFilter {
Copy link
Member Author

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

@marchof
Copy link
Member

marchof commented Aug 18, 2018

@Godin I rebased this PR. Can you please re-check before merge?

@Godin Godin merged commit 215f766 into master Aug 18, 2018
Filtering automation moved this from In Progress to Done Aug 18, 2018
Current work items automation moved this from Review to Done Aug 18, 2018
@Godin Godin deleted the kotlin_when_enum branch August 18, 2018 18:07
@jacoco jacoco locked as resolved and limited conversation to collaborators Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Filtering
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants