Minor, fix warnings in codegen

This commit is contained in:
Alexander Udalov
2013-09-26 20:14:38 +04:00
parent 54db0e30c0
commit ead8833a88
@@ -104,8 +104,8 @@ public abstract class ClassBodyCodegen extends MemberCodegen {
generatePrimaryConstructorProperties(propertyCodegen, myClass); generatePrimaryConstructorProperties(propertyCodegen, myClass);
} }
private boolean shouldProcessFirst(JetDeclaration declaration) { private static boolean shouldProcessFirst(JetDeclaration declaration) {
return false == (declaration instanceof JetProperty || declaration instanceof JetNamedFunction); return !(declaration instanceof JetProperty || declaration instanceof JetNamedFunction);
} }
@@ -163,7 +163,7 @@ public abstract class ClassBodyCodegen extends MemberCodegen {
} }
} }
@Nullable @NotNull
protected MethodVisitor createOrGetClInitMethod() { protected MethodVisitor createOrGetClInitMethod() {
if (clInitMethod == null) { if (clInitMethod == null) {
clInitMethod = v.newMethod(null, ACC_STATIC, "<clinit>", "()V", null, null); clInitMethod = v.newMethod(null, ACC_STATIC, "<clinit>", "()V", null, null);
@@ -171,10 +171,9 @@ public abstract class ClassBodyCodegen extends MemberCodegen {
return clInitMethod; return clInitMethod;
} }
@Nullable @NotNull
protected ExpressionCodegen createOrGetClInitCodegen() { protected ExpressionCodegen createOrGetClInitCodegen() {
assert state.getClassBuilderMode() == ClassBuilderMode.FULL; assert state.getClassBuilderMode() == ClassBuilderMode.FULL;
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
if (clInitCodegen == null) { if (clInitCodegen == null) {
MethodVisitor method = createOrGetClInitMethod(); MethodVisitor method = createOrGetClInitMethod();
method.visitCode(); method.visitCode();
@@ -187,7 +186,6 @@ public abstract class ClassBodyCodegen extends MemberCodegen {
clInitCodegen = new ExpressionCodegen(method, new FrameMap(), Type.VOID_TYPE, context.intoFunction(clInit), state); clInitCodegen = new ExpressionCodegen(method, new FrameMap(), Type.VOID_TYPE, context.intoFunction(clInit), state);
} }
}
return clInitCodegen; return clInitCodegen;
} }
} }