Don't remove constructor with super call
This commit is contained in:
@@ -36,7 +36,8 @@ 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())) {
|
||||
it.remove();
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user