Commit 76feab3f authored by Skylot's avatar Skylot

Don't remove constructor with super call

parent 550659d3
......@@ -36,6 +36,7 @@ public class ClassModifier extends AbstractVisitor {
&& mth.getArguments(false).isEmpty()) {
List<BlockNode> bb = mth.getBasicBlocks();
if (bb.isEmpty() || (bb.size() == 1 && bb.get(0).getInstructions().isEmpty())) {
if (mth.getSuperCall() == null)
it.remove();
}
}
......
......@@ -5,6 +5,11 @@ public class TestInner extends AbstractTest {
public static int count = -2;
public static class MyThread extends Thread {
public MyThread(String name) {
super(name);
}
@Override
public void run() {
count++;
......@@ -12,7 +17,7 @@ public class TestInner extends AbstractTest {
}
}
public static class MyInceptionThread extends Thread {
public static class MyInceptionThread extends MyThread {
public static class MyThread2 extends Thread {
@Override
......@@ -21,6 +26,10 @@ public class TestInner extends AbstractTest {
}
}
public MyInceptionThread() {
super("MyInceptionThread");
}
@Override
public void run() {
MyThread2 thr = new MyThread2();
......@@ -62,7 +71,7 @@ public class TestInner extends AbstractTest {
};
myRunnable.run();
MyThread thread = new TestInner.MyThread();
MyThread thread = new TestInner.MyThread("my thread");
thread.start();
MyInceptionThread thread2 = new TestInner.MyInceptionThread();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment