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 #26: split ConstantCollector into two classes #31

Merged
merged 16 commits into from
Oct 7, 2016

Conversation

danglotb
Copy link
Member

@danglotb danglotb commented Oct 4, 2016

No description provided.

* Created by bdanglot on 10/4/16.
*/
public class DefaultConstantCollector extends AbstractProcessor<CtLiteral> {

Copy link
Member Author

Choose a reason for hiding this comment

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

This class has no impact on the state of the program (contain only some checks and return statement). We should just remove it IMHO.

Copy link
Contributor

Choose a reason for hiding this comment

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

We collect all literals by default also in SMT mode.


@Override
public boolean isToBeProcessed(CtLiteral candidate) {
CtMethod parent = candidate.getParent(CtMethod.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't care about the parent, remove the tests

if (candidate.getValue() instanceof Boolean) {
return false;
} else if (candidate.getValue() instanceof Number) {// 3 defaults value will be added anyway
if (candidate.getValue().equals(1) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

@monperrus monperrus merged commit f434e5a into SpoonLabs:master Oct 7, 2016
monperrus pushed a commit that referenced this pull request Oct 10, 2016
@danglotb danglotb deleted the constant-collector branch October 21, 2016 12:21
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.

None yet

2 participants