mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-03-14 03:40:25 +08:00
warn for non-static inner mock class
This commit is contained in:
parent
2a54fe70dd
commit
9eb8682ec0
@ -270,9 +270,12 @@ public class TestableClassTransformer implements ClassFileTransformer {
|
||||
}
|
||||
// look for Mock inner class
|
||||
for (InnerClassNode ic : cn.innerClasses) {
|
||||
if ((ic.access & ACC_PUBLIC) != 0 && (ic.access & ACC_STATIC) != 0 &&
|
||||
ic.name.equals(getInnerMockClassName(className))) {
|
||||
return ic.name;
|
||||
if ((ic.access & ACC_PUBLIC) != 0 && ic.name.equals(getInnerMockClassName(className))) {
|
||||
if ((ic.access & ACC_STATIC) != 0) {
|
||||
return ic.name;
|
||||
} else {
|
||||
LogUtil.warn(String.format("Mock class in \"%s\" is not static", className));
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user