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

Bug: AnonymousClass with noclasspath flag #707

Closed
danglotb opened this issue Jun 16, 2016 · 2 comments
Closed

Bug: AnonymousClass with noclasspath flag #707

danglotb opened this issue Jun 16, 2016 · 2 comments

Comments

@danglotb
Copy link
Member

Snippet code example:

private final ConflictTimer lbdTimer = new ConflictTimerAdapter(1000) {
        private static final long serialVersionUID = 1L;
        private int nbconflict = 0;
        private static final int MAX_CLAUSE = 5000;
        private static final int INC_CLAUSE = 1000;
        private int nextbound = MAX_CLAUSE;

        @Override
        public void run() {
            this.nbconflict += bound();
            if (this.nbconflict >= this.nextbound) {
                this.nextbound += INC_CLAUSE;
                // if (nextbound > wall) {
                // nextbound = wall;
                // }
                this.nbconflict = 0;
                Solver.this.needToReduceDB = true;
            }
        }

        @Override
        public void reset() {
            super.reset();
            this.nextbound = MAX_CLAUSE;
            if (this.nbconflict >= this.nextbound) {
                this.nbconflict = 0;
                Solver.this.needToReduceDB = true;
            }
        }
    };

When we use spoon on it with -x flag:

private final org.sat4j.minisat.core.ConflictTimer lbdTimer = new ConflictTimerAdapter(1000) {
        private static final long serialVersionUID = 1L;

        private int nbconflict = 0;

        private static final int MAX_CLAUSE = 5000;

        private static final int INC_CLAUSE = 1000;

        private int nextbound = MAX_CLAUSE;

        @java.lang.Override
        public void run() {
            this.nbconflict += org.sat4j.minisat.core.Solver.6.bound();
            if ((this.nbconflict) >= (this.nextbound)) {
                this.nextbound += INC_CLAUSE;
                this.nbconflict = 0;
                org.sat4j.minisat.core.Solver.this.needToReduceDB = true;
            } 
        }

        @java.lang.Override
        public void reset() {
            super.reset();
            this.nextbound = MAX_CLAUSE;
            if ((this.nbconflict) >= (this.nextbound)) {
                this.nbconflict = 0;
                org.sat4j.minisat.core.Solver.this.needToReduceDB = true;
            } 
        }
    };

The line org.sat4j.minisat.core.Solver.6.bound() is wrong. It contains the index of the Anonymous in Solver.java (the top class).

@GerardPaligot
Copy link
Contributor

I can't reproduce your bug. Maybe you can give us the entire content of your snippet?

@danglotb
Copy link
Member Author

danglotb commented Jul 1, 2016

Hi, you can find the class here (2,6k lines) named Solver.

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

No branches or pull requests

2 participants