else on the next line
as requested by http://confluence.jetbrains.net/display/JET/Code+Conventions+for+Java (sed is your friend)
This commit is contained in:
@@ -64,7 +64,8 @@ public class CompilationException extends RuntimeException {
|
||||
Throwable cause = getCause();
|
||||
if (cause != null && cause.getStackTrace().length > 0) {
|
||||
return cause.getStackTrace()[0].getFileName() + ":" + cause.getStackTrace()[0].getLineNumber();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return "far away in cyberspace";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2247,7 +2247,8 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
type = typeMapper.mapType(expressionType, MapTypeMode.VALUE);
|
||||
if (type.getSort() == Type.ARRAY) {
|
||||
generateNewArray(expression, expressionType);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ClassDescriptor classDecl = (ClassDescriptor) constructorDescriptor.getContainingDeclaration();
|
||||
|
||||
v.anew(type);
|
||||
|
||||
@@ -128,7 +128,8 @@ public class FunctionCodegen {
|
||||
if (needJetAnnotations) {
|
||||
if (functionDescriptor instanceof PropertyAccessorDescriptor) {
|
||||
PropertyCodegen.generateJetPropertyAnnotation(mv, propertyTypeSignature, jvmSignature.getKotlinTypeParameter());
|
||||
} else if (functionDescriptor instanceof SimpleFunctionDescriptor) {
|
||||
}
|
||||
else if (functionDescriptor instanceof SimpleFunctionDescriptor) {
|
||||
if (propertyTypeSignature != null) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
@@ -138,7 +139,8 @@ public class FunctionCodegen {
|
||||
aw.writeTypeParameters(jvmSignature.getKotlinTypeParameter());
|
||||
aw.writeReturnType(jvmSignature.getKotlinReturnType());
|
||||
aw.visitEnd();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
int innerClassAccess = ACC_PUBLIC;
|
||||
if (innerClass.getModality() == Modality.FINAL) {
|
||||
innerClassAccess |= ACC_FINAL;
|
||||
} else if (innerClass.getModality() == Modality.ABSTRACT) {
|
||||
}
|
||||
else if (innerClass.getModality() == Modality.ABSTRACT) {
|
||||
innerClassAccess |= ACC_ABSTRACT;
|
||||
}
|
||||
|
||||
@@ -193,7 +194,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
if (superClassType == null) {
|
||||
signatureVisitor.writeClassBegin(superClass, false, false);
|
||||
signatureVisitor.writeClassEnd();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
typeMapper.mapType(superClassType, signatureVisitor, MapTypeMode.TYPE_PARAMETER);
|
||||
}
|
||||
signatureVisitor.writeSuperclassEnd();
|
||||
@@ -706,7 +708,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
CallableMemberDescriptor callableDescriptor = needDelegates.first;
|
||||
if (needDelegates.second instanceof SimpleFunctionDescriptor) {
|
||||
generateDelegationToTraitImpl(codegen, (FunctionDescriptor) needDelegates.second);
|
||||
} else if (needDelegates.second instanceof PropertyDescriptor) {
|
||||
}
|
||||
else if (needDelegates.second instanceof PropertyDescriptor) {
|
||||
PropertyDescriptor property = (PropertyDescriptor) needDelegates.second;
|
||||
for (PropertyAccessorDescriptor accessor : property.getAccessors()) {
|
||||
generateDelegationToTraitImpl(codegen, accessor);
|
||||
|
||||
@@ -192,7 +192,8 @@ public class JetTypeMapper {
|
||||
"conflicting namespace " + fqName + ": it is both java statics and from src");
|
||||
}
|
||||
classStatics = javaNamespaceKind == JavaNamespaceKind.CLASS_STATICS;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
classStatics = false;
|
||||
}
|
||||
|
||||
@@ -356,7 +357,8 @@ public class JetTypeMapper {
|
||||
Type r;
|
||||
if (!isGenericsArray(jetType)) {
|
||||
r = Type.getType("[" + boxType(mapType(memberType, kind)).getDescriptor());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
r = ARRAY_GENERIC_TYPE;
|
||||
}
|
||||
checkValidType(r);
|
||||
@@ -383,7 +385,8 @@ public class JetTypeMapper {
|
||||
|
||||
asmType = JL_COMPARABLE_TYPE;
|
||||
forceReal = false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
JvmClassName name = getClassFQName((ClassDescriptor) descriptor);
|
||||
asmType = Type.getObjectType(name.getInternalName() + (kind == MapTypeMode.TRAIT_IMPL ? JvmAbi.TRAIT_IMPL_SUFFIX : ""));
|
||||
forceReal = isForceReal(name);
|
||||
@@ -426,7 +429,8 @@ public class JetTypeMapper {
|
||||
}
|
||||
checkValidType(boxed);
|
||||
return boxed;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (signatureVisitor != null) {
|
||||
visitAsmType(signatureVisitor, asmType, jetType.isNullable());
|
||||
}
|
||||
@@ -455,7 +459,8 @@ public class JetTypeMapper {
|
||||
JvmPrimitiveType jvmPrimitiveType = JvmPrimitiveType.getByWrapperAsmType(type);
|
||||
if (jvmPrimitiveType != null) {
|
||||
return jvmPrimitiveType.getAsmType();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
throw new UnsupportedOperationException("Unboxing: " + type);
|
||||
}
|
||||
}
|
||||
@@ -464,7 +469,8 @@ public class JetTypeMapper {
|
||||
JvmPrimitiveType jvmPrimitiveType = JvmPrimitiveType.getByAsmType(asmType);
|
||||
if (jvmPrimitiveType != null) {
|
||||
return jvmPrimitiveType.getWrapper().getAsmType();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return asmType;
|
||||
}
|
||||
}
|
||||
@@ -508,7 +514,8 @@ public class JetTypeMapper {
|
||||
ClassDescriptor receiver;
|
||||
if (currentIsInterface && !originalIsInterface) {
|
||||
receiver = declarationOwner;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
receiver = currentOwner;
|
||||
}
|
||||
|
||||
@@ -548,7 +555,8 @@ public class JetTypeMapper {
|
||||
//if (function.getKind() == CallableMemberDescriptor.Kind.DECLARATION) {
|
||||
if (function.getOverriddenDescriptors().isEmpty()) {
|
||||
return function;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// TODO: prefer class to interface
|
||||
return findAnyDeclaration(function.getOverriddenDescriptors().iterator().next());
|
||||
}
|
||||
@@ -600,7 +608,8 @@ public class JetTypeMapper {
|
||||
|
||||
if (f instanceof ConstructorDescriptor) {
|
||||
signatureVisitor.writeVoidReturn();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
signatureVisitor.writeReturnType();
|
||||
mapReturnType(f.getReturnType(), signatureVisitor);
|
||||
signatureVisitor.writeReturnTypeEnd();
|
||||
|
||||
@@ -185,7 +185,8 @@ public class PropertyCodegen {
|
||||
mv.visitCode();
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
StubCodegen.generateStubThrow(mv);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
if (kind != OwnerKind.NAMESPACE) {
|
||||
iv.load(0, JetTypeMapper.TYPE_OBJECT);
|
||||
@@ -268,7 +269,8 @@ public class PropertyCodegen {
|
||||
mv.visitCode();
|
||||
if (v.generateCode() == ClassBuilder.Mode.STUBS) {
|
||||
StubCodegen.generateStubThrow(mv);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
final Type type = state.getInjector().getJetTypeMapper().mapType(propertyDescriptor.getType(), MapTypeMode.VALUE);
|
||||
int paramCode = 0;
|
||||
|
||||
@@ -51,7 +51,8 @@ public abstract class StackValue {
|
||||
}
|
||||
if (type == Type.VOID_TYPE) {
|
||||
instructionAdapter.aconst(null);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Type boxed = JetTypeMapper.boxType(type);
|
||||
instructionAdapter.invokestatic(boxed.getInternalName(), "valueOf", "(" + type.getDescriptor() + ")" + boxed.getDescriptor());
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ public class ArrayIterator implements IntrinsicMethod {
|
||||
if(containingDeclaration.equals(standardLibrary.getArray())) {
|
||||
v.invokestatic("jet/runtime/ArrayIterator", "iterator", "([Ljava/lang/Object;)Ljet/Iterator;");
|
||||
return StackValue.onStack(JetTypeMapper.TYPE_ITERATOR);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for (JvmPrimitiveType jvmPrimitiveType : JvmPrimitiveType.values()) {
|
||||
PrimitiveType primitiveType = jvmPrimitiveType.getPrimitiveType();
|
||||
ClassDescriptor arrayClass = standardLibrary.getPrimitiveArrayClassDescriptor(primitiveType);
|
||||
|
||||
@@ -100,7 +100,8 @@ public class BothSignatureWriter {
|
||||
|
||||
if (DEBUG_SIGNATURE_WRITER) {
|
||||
signatureVisitor = new CheckSignatureAdapter(mode.asmType, signatureWriter);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
signatureVisitor = signatureWriter;
|
||||
}
|
||||
}
|
||||
@@ -192,14 +193,16 @@ public class BothSignatureWriter {
|
||||
if (nullable) {
|
||||
signatureVisitor().visitClassType("java/lang/Object");
|
||||
signatureVisitor().visitEnd();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
signatureVisitor().visitBaseType('V');
|
||||
}
|
||||
jetSignatureWriter.visitClassType("jet/Nothing", nullable, false);
|
||||
jetSignatureWriter.visitEnd();
|
||||
if (nullable) {
|
||||
writeAsmType0(JetTypeMapper.TYPE_OBJECT);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
writeAsmType0(Type.VOID_TYPE);
|
||||
}
|
||||
}
|
||||
@@ -513,7 +516,8 @@ public class BothSignatureWriter {
|
||||
makeKotlinParameterTypes(),
|
||||
makeKotlinReturnTypeSignature()
|
||||
);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return new JvmMethodSignature(makeAsmMethod(name), makeKotlinParameterTypes());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,8 @@ public class JvmMethodSignature {
|
||||
checkGenericsAvailable();
|
||||
if (kotlinParameterTypes == null) {
|
||||
return "";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return kotlinParameterTypes.get(i).getKotlinSignature();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,8 @@ public final class TipsManager {
|
||||
resolutionScope, new ExpressionReceiver(receiverExpression, expressionType));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return getVariantsNoReceiver(expression, context);
|
||||
}
|
||||
}
|
||||
@@ -72,7 +73,8 @@ public final class TipsManager {
|
||||
if (resolutionScope != null) {
|
||||
if (expression.getParent() instanceof JetImportDirective || expression.getParent() instanceof JetNamespaceHeader) {
|
||||
return excludeNonPackageDescriptors(resolutionScope.getAllDescriptors());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
HashSet<DeclarationDescriptor> descriptorsSet = Sets.newHashSet();
|
||||
|
||||
ArrayList<ReceiverDescriptor> result = new ArrayList<ReceiverDescriptor>();
|
||||
|
||||
Reference in New Issue
Block a user