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 { ...@@ -36,6 +36,7 @@ public class ClassModifier extends AbstractVisitor {
&& mth.getArguments(false).isEmpty()) { && mth.getArguments(false).isEmpty()) {
List<BlockNode> bb = mth.getBasicBlocks(); List<BlockNode> bb = mth.getBasicBlocks();
if (bb.isEmpty() || (bb.size() == 1 && bb.get(0).getInstructions().isEmpty())) { if (bb.isEmpty() || (bb.size() == 1 && bb.get(0).getInstructions().isEmpty())) {
if (mth.getSuperCall() == null)
it.remove(); it.remove();
} }
} }
......
...@@ -5,6 +5,11 @@ public class TestInner extends AbstractTest { ...@@ -5,6 +5,11 @@ public class TestInner extends AbstractTest {
public static int count = -2; public static int count = -2;
public static class MyThread extends Thread { public static class MyThread extends Thread {
public MyThread(String name) {
super(name);
}
@Override @Override
public void run() { public void run() {
count++; count++;
...@@ -12,7 +17,7 @@ public class TestInner extends AbstractTest { ...@@ -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 { public static class MyThread2 extends Thread {
@Override @Override
...@@ -21,6 +26,10 @@ public class TestInner extends AbstractTest { ...@@ -21,6 +26,10 @@ public class TestInner extends AbstractTest {
} }
} }
public MyInceptionThread() {
super("MyInceptionThread");
}
@Override @Override
public void run() { public void run() {
MyThread2 thr = new MyThread2(); MyThread2 thr = new MyThread2();
...@@ -62,7 +71,7 @@ public class TestInner extends AbstractTest { ...@@ -62,7 +71,7 @@ public class TestInner extends AbstractTest {
}; };
myRunnable.run(); myRunnable.run();
MyThread thread = new TestInner.MyThread(); MyThread thread = new TestInner.MyThread("my thread");
thread.start(); thread.start();
MyInceptionThread thread2 = new TestInner.MyInceptionThread(); 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